home *** CD-ROM | disk | FTP | other *** search
/ Doom 3 - Resurrection of …l (USA) (Xbox Press Kit) / Doom 3 - Resurrection of Evil (USA) (Xbox Press Kit).bin / Doom3_ROE_Xbox_Press / screenshots / includes / CSScriptLib.js
Text File  |  2005-10-11  |  76KB  |  2,203 lines

  1. /* -- Global Functions */
  2. CSStateArray = new Object;
  3. CSCookieArray = new Object;
  4. CSCookieValArray = new Object;
  5. function CSWriteCookie(action) {
  6.     var name   = "DFT" + action[1];
  7.     var hrs    = action[2];
  8.     var path   = action[3];
  9.     var domain = action[4];
  10.     var secure = action[5];    
  11.     var exp    = new Date((new Date()).getTime() + hrs * 3600000);    
  12.     var cookieVal = "";
  13.     for(var prop in CSCookieArray) {
  14.         if(("DFT" + CSCookieArray[prop]) == name) {
  15.             if(cookieVal != "") cookieVal += "&";
  16.             cookieVal += prop + ":" + escape(CSStateArray[prop]);
  17.         }
  18.     }
  19.     if(hrs != 0)
  20.         cookieVal += "; expires=" + exp.toGMTString();
  21.     if(path != "")
  22.         cookieVal += "; path=" + path;
  23.     if(domain != "")
  24.         cookieVal += "; domain=" + domain;
  25.     if(secure == true)
  26.         cookieVal += "; secure";
  27.     document.cookie = name + '=' + cookieVal;
  28. }
  29. function CSReadCookie(action) {
  30.     var name    = "DFT" + action[1];
  31.     var cookies = document.cookie;
  32.     if(cookies == "") return;
  33.     var start = cookies.indexOf(name);
  34.     if(start == -1) return;
  35.     start += name.length + 1;
  36.     var end = cookies.indexOf(";", start);
  37.     if(end == -1) end = cookies.length;
  38.     var cookieVal = cookies.substring(start, end);
  39.     var arr = cookieVal.split('&');
  40.     for(var i = 0; i < arr.length; i++) {
  41.         var a = arr[i].split(':');
  42.         CSStateArray[a[0]] = unescape(a[1]);
  43.     }    
  44. }
  45. function CSDefineState(action) {
  46.     CSCookieArray[action[1]] = action[3]; 
  47. }
  48. function CSSetState(action) {
  49.     CSStateArray[action[1]] = action[2];
  50. }
  51. function CSInitState(action) {
  52.     if(typeof(CSStateArray[action[1]]) == "undefined")
  53.         CSStateArray[action[1]] = action[2];
  54. }
  55. function CSCheckState(action) {
  56.     var obj1 = CSStateArray[action[1]];
  57.     var obj2 = action[2];
  58.     if(typeof(obj1) == "object") {
  59.         for(var i=0;i<obj1.length;i++) {
  60.             if(obj1[i] != obj2[i])
  61.                 return false;
  62.             }
  63.         return true;
  64.         }
  65.     var res;
  66.     var op = action[3];
  67.              if(op == "==") res = (CSStateArray[action[1]] == action[2]);    
  68.         else if(op == "!=") res = (CSStateArray[action[1]] != action[2]);    
  69.         else if(op == ">" ) res = (CSStateArray[action[1]] >  action[2]);    
  70.         else if(op == ">=") res = (CSStateArray[action[1]] >= action[2]);    
  71.         else if(op == "<" ) res = (CSStateArray[action[1]] <  action[2]);    
  72.         else if(op == "<=") res = (CSStateArray[action[1]] <= action[2]);    
  73.     return res;
  74. }
  75. CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);
  76. CSIsW3CDOM = ((document.getElementById) && !(IsIE()&&CSBVers<6)) ? true : false;
  77. function IsIE() { return CSAg.indexOf("MSIE") > 0;}
  78. function CSIEStyl(s) { return document.all.tags("div")[s].style; }
  79. function CSNSStyl(s) { if (CSIsW3CDOM) return document.getElementById(s).style; else return CSFindElement(s,0);  }
  80. CSIImg=false;
  81. function CSInitImgID() {if (!CSIImg && document.images) { for (var i=0; i<document.images.length; i++) { if (!document.images[i].id) document.images[i].id=document.images[i].name; } CSIImg = true;}}
  82. function CSFindElement(n,ly) { if (CSBVers<4) return document[n];
  83.     if (CSIsW3CDOM) {CSInitImgID();return(document.getElementById(n));}
  84.     var curDoc = ly?ly.document:document; var elem = curDoc[n];
  85.     if (!elem) {for (var i=0;i<curDoc.layers.length;i++) {elem=CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
  86.     return elem;
  87. }
  88. function CSGetImage(n) {if(document.images) {return ((!IsIE()&&CSBVers<5)?CSFindElement(n,0):document.images[n]);} else {return null;}}
  89. CSDInit=false;
  90. function CSIDOM() { if (CSDInit)return; CSDInit=true; if(document.getElementsByTagName) {var n = document.getElementsByTagName('DIV'); for (var i=0;i<n.length;i++) {CSICSS2Prop(n[i].id);}}}
  91. function CSICSS2Prop(id) { var n = document.getElementsByTagName('STYLE');for (var i=0;i<n.length;i++) { var cn = n[i].childNodes; for (var j=0;j<cn.length;j++) { CSSetCSS2Props(CSFetchStyle(cn[j].data, id),id); }}}
  92. function CSFetchStyle(sc, id) {
  93.     var s=sc; while(s.indexOf("#")!=-1) { s=s.substring(s.indexOf("#")+1,sc.length); if (s.substring(0,s.indexOf("{")).toUpperCase().indexOf(id.toUpperCase())!=-1) return(s.substring(s.indexOf("{")+1,s.indexOf("}")));}
  94.     return "";
  95. }
  96. function CSGetStyleAttrValue (si, id) {
  97.     var s=si.toUpperCase();
  98.     var myID=id.toUpperCase()+":";
  99.     var id1=s.indexOf(myID);
  100.     if (id1==-1) return "";
  101.     s=s.substring(id1+myID.length+1,si.length);
  102.     var id2=s.indexOf(";");
  103.     return ((id2==-1)?s:s.substring(0,id2));
  104. }
  105. function CSSetCSS2Props(si, id) {
  106.     var el=document.getElementById(id);
  107.     if (el==null) return;
  108.     var style=document.getElementById(id).style;
  109.     if (style) {
  110.         if (style.left=="") style.left=CSGetStyleAttrValue(si,"left");
  111.         if (style.top=="") style.top=CSGetStyleAttrValue(si,"top");
  112.         if (style.width=="") style.width=CSGetStyleAttrValue(si,"width");
  113.         if (style.height=="") style.height=CSGetStyleAttrValue(si,"height");
  114.         if (style.visibility=="") style.visibility=CSGetStyleAttrValue(si,"visibility");
  115.         if (style.zIndex=="") style.zIndex=CSGetStyleAttrValue(si,"z-index");
  116.     }
  117. }
  118. function CSSetStylePos(s,d,p) {
  119.     if (CSIsW3CDOM)d==0?document.getElementById(s).style.left=p+"px":document.getElementById(s).style.top=p+"px";
  120.     else if(IsIE())(d==0)?CSIEStyl(s).posLeft=p:CSIEStyl(s).posTop=p;
  121.     else (d==0)?CSNSStyl(s).left=p:CSNSStyl(s).top=p;
  122. }
  123. function CSGetStylePos(s,d) {
  124.     if (CSIsW3CDOM){CSIDOM();return parseInt((d==0)?document.getElementById(s).style.left:document.getElementById(s).style.top);}
  125.     else if (IsIE()) {CSIEWinInit();return(d==0)?CSIEStyl(s).posLeft:CSIEStyl(s).posTop;}
  126.     else {return (d==0)?CSNSStyl(s).left:CSNSStyl(s).top;}
  127. }
  128. CSIEWInit=false;
  129. function CSIEWinInit() { if(CSIEWInit==true) return; else CSIEWInit=true; if (IsIE()&&(CSAg.indexOf("Win")!=-1)&&CSBVers==4) { var i=0; var lyr=document.all.tags("div")[i++]; while(lyr) {lyr.style.posLeft=lyr.offsetLeft; lyr.style.posTop=lyr.offsetTop; lyr=document.all.tags("div")[i++];}}}
  130. CSLoopIsRunning = false; CSFctArray = new Array; CSTimeoutID = null;
  131. function CSLoop() {    
  132.     CSLoopIsRunning = false;
  133.     for (i=0;i<CSFctArray.length;i++) {
  134.         var curFct = CSFctArray[i];
  135.         if (curFct)    {
  136.             if (curFct.DoFunction(curFct)) { CSLoopIsRunning = true; curFct.counter++; }
  137.             else CSFctArray[i] = 0;
  138.         }
  139.     }
  140.     if (CSLoopIsRunning) CSTimeoutID = setTimeout("CSLoop()", 1);
  141. }
  142. function CSStartFunction(fct,data) {
  143.     if (!CSLoopIsRunning) { CSFctArray = 0; CSFctArray = new Array; }
  144.     var fctInfo = new Object;
  145.     fctInfo.DoFunction = fct; fctInfo.counter = 0; fctInfo.data = data;
  146.     CSFctArray[CSFctArray.length] = fctInfo; 
  147.     if (!CSLoopIsRunning) CSLoop();
  148. }
  149. function CSStopFunction(sceneName) {
  150.     var i;
  151.     for (i=0;i<CSFctArray.length;i++) {
  152.         var curFct = CSFctArray[i];
  153.         if (curFct){ if (curFct.data.name == sceneName){ CSFctArray[i] = 0; return; } }
  154.     }
  155. }
  156. function CSStopComplete() {
  157.     if (CSTimeoutID == null) return;
  158.     clearTimeout (CSTimeoutID); CSLoopIsRunning = false; CSTimeoutID = null;
  159. }
  160. function CSMoveLoop(fInf) {
  161.     var ticks = 60 * (((new Date()).getTime()) - fInf.data.startTime)/1000;
  162.     var f = ticks/fInf.data.ticks;
  163.     if (f < 1) { CSSetStylePos(fInf.data.layer,0,fInf.data.start[0] * (1-f) + fInf.data.end[0] * f);
  164.         CSSetStylePos(fInf.data.layer,1,fInf.data.start[1] * (1-f) + fInf.data.end[1] * f); return true; }
  165.     else { CSSetStylePos(fInf.data.layer,0,fInf.data.end[0]);
  166.         CSSetStylePos(fInf.data.layer,1,fInf.data.end[1]); }
  167.     return false;
  168. }
  169. function CSSlideObj (layer,start,end,ticks,startTime) {
  170.     this.layer=layer;this.start=start;this.end=end;this.ticks=ticks;this.startTime=startTime;
  171. }
  172. function CSSlideLayer(l,pos,anim,ticks) {
  173.     var x = pos[0]; var y = pos[1];
  174.     if (l == '') return;
  175.     if (ticks < 0) ticks = 0;
  176.     if (!anim) { CSSetStylePos(l,0,x); CSSetStylePos(l,1,y); }
  177.     else {  var fctData = new CSSlideObj(l,new Array(CSGetStylePos(l,0),CSGetStylePos(l,1)),new Array(x,y),ticks,(new Date()).getTime()); CSStartFunction(CSMoveLoop,fctData); }
  178. }
  179. function ROFindEmbed (name) {
  180.     /* only for netscape */
  181.     if(CSIsW3CDOM) {
  182.         var emb=null;
  183.         for(j=0; j<document.embeds.length; j++) {
  184.             if(document.embeds[j].name==name) {
  185.                 emb=document.embeds[j]; break;
  186.             }
  187.         }
  188.         return emb;
  189.     }
  190.     else
  191.         return CSFindElement(name);
  192. }
  193. function ROUnpackVersionNumber(n) {
  194.    return "" + (n >> 28) + "." +
  195.    ((n & 0xFF00000) >> 20) + "." + 
  196.    ((n & 0xFF000) >> 12) + "." + 
  197.    ( n & 0xFFF);
  198. }
  199. function CSSetStyleVis(s,v) {
  200.     if (CSIsW3CDOM){CSIDOM();document.getElementById(s).style.visibility=(v==0)?"hidden":"visible";}
  201.     else if(IsIE())CSIEStyl(s).visibility=(v==0)?"hidden":"visible";
  202.     else CSNSStyl(s).visibility=(v==0)?'hide':'show';
  203. }
  204. function CSGetStyleVis(s) {
  205.     if (CSIsW3CDOM) {CSIDOM();return(document.getElementById(s).style.visibility=="hidden")?0:1;}
  206.     else if(IsIE())return(CSIEStyl(s).visibility=="hidden")?0:1;
  207.     else return(CSNSStyl(s).visibility=='hide')?0:1;
  208. }
  209. ROOnPLCArray=new Array();
  210. function RPOnPositionLengthChange (position, length) {
  211.     for(var i=0;i<ROOnPLCArray.length;i++) {
  212.         var obj=ROOnPLCArray[i];
  213.         if(typeof(obj)=="object") { 
  214.             if(obj.time==position) {
  215.                 if(obj.type=="navigate") {
  216.                     window.parent.external.HandleAction("NavigateToURL("+obj.url+","+obj.target+")");
  217.                     ROOnPLCArray[i]=0;
  218.                 }
  219.                 else if(obj.type=="color") {
  220.                     window.parent.external.SetVideoBackgroundColor(obj.color);
  221.                     ROOnPLCArray[i]=0;
  222.                 }
  223.             }
  224.         }
  225.     }
  226. }
  227. function CSGetLayerClip (el) {
  228.     CSIDOM();
  229.     if (el.isIE) return (new CSRect(0,0,el.offsetWidth,el.offsetHeight));
  230.     else if (CSBVers>=5) return (new CSRect(0,0,parseInt(el.style.width),parseInt(el.style.height)));
  231.     else return (new CSRect(el.clip.left,el.clip.top,el.clip.width,el.clip.height));
  232. }
  233. function CSSetLayerClip (el,clipRect) {
  234.     var l,t,r,b;
  235.     l=clipRect.left; t=clipRect.top; r=l+clipRect.width; b=t+clipRect.height;
  236.     if(el.isIE) { el.style.clip = "rect("+ t + " " + r + " " + b + " " + l + ")"; }
  237.     else if (CSBVers>=5) el.style.clip = "rect("+ t + "px, " + r + "px, " + b + "px, " + l + "px)";
  238.     else { el.clip.left=l; el.clip.top=t; el.clip.width=clipRect.width; el.clip.height=clipRect.height; }
  239.     CSSetStyleVis(el.layer);
  240. }
  241. function CSRect (left,top,width,height) {
  242. this.left=left; this.top=top; this.width=width; this.height=height;
  243. }
  244. function CSCreateTransElement (layer, steps) {
  245.     var el;
  246.     if (IsIE()) el=document.all.tags("div")[layer];
  247.     else if (CSBVers>=5) el=document.getElementById(layer);
  248.     else el=CSNSStyl(layer);
  249.     if (el==null) return null;
  250.     if (el.locked && (el.locked == true)) return null;
  251.     el.isIE=IsIE();
  252.     el.clipRect=CSGetLayerClip(el);
  253.     if (el.clipRect==null) return null;
  254.     el.maxValue=steps;
  255.     if (el.maxValue<=0) el.maxValue=30;
  256.     el.modus=""; el.layer=layer;
  257.     el.width=el.clipRect.width; el.height=el.clipRect.height;
  258.     el.locked = true;
  259.     return el;
  260. }
  261. function CSDisposeTransElement (el) { el.locked = false; }
  262. function CSScriptInit() {
  263. if(typeof(skipPage) != "undefined") { if(skipPage) return; }
  264. idxArray = new Array;
  265. for(var i=0;i<CSInit.length;i++)
  266.     idxArray[i] = i;
  267. CSAction2(CSInit, idxArray);
  268. }
  269. function CSScriptExit() {
  270. idxArray = new Array;
  271. for(var i=0;i<CSExit.length;i++)
  272.     idxArray[i] = i;
  273. CSAction2(CSExit, idxArray);
  274. }
  275. CSInit = new Array;
  276. CSExit = new Array;
  277. CSStopExecution=false;
  278. function CSAction(array) {return CSAction2(CSAct, array);}
  279. function CSAction2(fct, array) { 
  280.     var result;
  281.     for (var i=0;i<array.length;i++) {
  282.         if(CSStopExecution) return false; 
  283.         var aa = fct[array[i]];
  284.         if (aa == null) return false;
  285.         var ta = new Array;
  286.         for(var j=1;j<aa.length;j++) {
  287.             if((aa[j]!=null)&&(typeof(aa[j])=="object")&&(aa[j].length==2)){
  288.                 if(aa[j][0]=="VAR"){ta[j]=CSStateArray[aa[j][1]];}
  289.                 else{if(aa[j][0]=="ACT"){ta[j]=CSAction(new Array(new String(aa[j][1])));}
  290.                 else ta[j]=aa[j];}
  291.             } else ta[j]=aa[j];
  292.         }            
  293.         result=aa[0](ta);
  294.     }
  295.     return result;
  296. }
  297. CSAct = new Object;
  298. CSIm=new Object();
  299. function CSIShow(n,i) {
  300.     if (document.images) {
  301.         if (CSIm[n]) {
  302.             var img=CSGetImage(n);
  303.             if (img&&typeof(CSIm[n][i].src)!="undefined") {img.src=CSIm[n][i].src;}
  304.             if(i!=0) self.status=CSIm[n][3]; else self.status=" ";
  305.             return true;
  306.         }
  307.     }
  308.     return false;
  309. }
  310. function CSILoad(action) {
  311.     im=action[1];
  312.     if (document.images) {
  313.         CSIm[im]=new Object();
  314.         for (var i=2;i<5;i++) {
  315.             if (action[i]!='') {CSIm[im][i-2]=new Image(); CSIm[im][i-2].src=action[i];}
  316.             else CSIm[im][i-2]=0;
  317.         }
  318.         CSIm[im][3] = action[5];
  319.     }
  320. }
  321. function newImage(arg) {
  322.     if (document.images) {
  323.         rslt = new Image();
  324.         rslt.src = arg;
  325.         return rslt;
  326.     }
  327. }
  328. userAgent = window.navigator.userAgent;
  329. browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
  330. mustInitImg = true;
  331. function initImgID() {var di = document.images; if (mustInitImg && di) { for (var i=0; i<di.length; i++) { if (!di[i].id) di[i].id=di[i].name; } mustInitImg = false;}}
  332. function findElement(n,ly) {
  333.     var d = document;
  334.     if (browserVers < 4)        return d[n];
  335.     if ((browserVers >= 6) && (d.getElementById)) {initImgID; return(d.getElementById(n))}; 
  336.     var cd = ly ? ly.document : d;
  337.     var elem = cd[n];
  338.     if (!elem) {
  339.         for (var i=0;i<cd.layers.length;i++) {
  340.             elem = findElement(n,cd.layers[i]);
  341.             if (elem) return elem;
  342.         }
  343.     }
  344.     return elem;
  345. }
  346. function changeImagesArray(array) {
  347.     if (preloadFlag == true) {
  348.         var d = document; var img;
  349.         for (i=0;i<array.length;i+=2) {
  350.             img = null; var n = array[i];
  351.             if (d.images) {
  352.                 if (d.layers) {img = findElement(n,0);}
  353.                 else {img = d.images[n];}
  354.             }
  355.             if (!img && d.getElementById) {img = d.getElementById(n);}
  356.             if (!img && d.getElementsByName) {
  357.                 var elms = d.getElementsByName(n);
  358.                 if (elms) {
  359.                     for (j=0;j<elms.length;j++) {
  360.                         if (elms[j].src) {img = elms[j]; break;}
  361.                     }
  362.                 }
  363.             }
  364.             if (img) {img.src = array[i+1];}
  365.         }
  366.     }
  367. }
  368. function changeImages() {
  369.     changeImagesArray(changeImages.arguments);
  370. }
  371. function toggleImages() {
  372.     for (var i=0; i<toggleImages.arguments.length; i+=2) {
  373.         if (selected == toggleImages.arguments[i])
  374.             changeImagesArray(toggleImages.arguments[i+1]);
  375.     }
  376. }
  377. function CSClickReturn () {
  378.     var bAgent = window.navigator.userAgent; 
  379.     var bAppName = window.navigator.appName;
  380.     if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))
  381.         return true; /* dont follow link */
  382.     else return false; /* dont follow link */
  383. }
  384. function CSButtonReturn () { return !CSClickReturn(); }
  385. function CSBrowserSwitch(action) {
  386.     var bAgent    = window.navigator.userAgent;
  387.     var bAppName    = window.navigator.appName;
  388.     var isNS        = (bAppName.indexOf("Netscape") >= 0);
  389.     var isIE        = (bAppName.indexOf("Explorer") >= 0);
  390.     var isWin        = (bAgent.indexOf("Win") >= 0); 
  391.     var isMac        = (bAgent.indexOf("Mac") >= 0); 
  392.     var vers        = 0;
  393.     var versIdx    = (bAgent.indexOf("Mozilla/"));
  394.     if(versIdx >= 0)
  395.         {
  396.         var sstr    = bAgent.substring(versIdx + 8, versIdx + 9);
  397.         vers        = parseInt(sstr) - 2;
  398.         }
  399.     var url        = action[1];
  400.     var platform    = action[2];
  401.     var versVec;
  402.     if(platform)
  403.         {
  404.         if(isNS && isMac) versVec = action[3];
  405.         if(isIE && isMac) versVec = action[5];
  406.         if(isNS && isWin) versVec = action[4];
  407.         if(isIE && isWin) versVec = action[6];
  408.         }
  409.     else
  410.         {
  411.         if(isNS) versVec = action[3];
  412.         if(isIE) versVec = action[4];
  413.         }
  414.     if(vers > (versVec.length-1))
  415.         vers = versVec.length-1;
  416.     if(versVec[vers] == 0)
  417.         {
  418.         location            = url;
  419.         CSStopExecution    = true;    
  420.         }
  421. }
  422. function CSURLPopupShow(formName, popupName, target) {
  423.     var form  = (!IsIE()&&CSBVers>=5)?document.forms[formName]:CSFindElement(formName);
  424.     var popup = form.elements[popupName];
  425.     window.open(popup.options[popup.selectedIndex].value, target);
  426.     popup.selectedIndex = 0;
  427. }
  428. function CSSetStyleDepth(s,depth) {
  429.     if (CSIsW3CDOM)document.getElementById(s).style.zIndex=depth;
  430.     else if (IsIE())CSIEStyl(s).zIndex=depth;
  431.     else CSNSStyl(s).zIndex=depth;
  432. }
  433. function CSGetStyleDepth(s) {
  434.     if (CSIsW3CDOM){CSIDOM();return document.getElementById(s).style.zIndex;}
  435.     else if (IsIE())return (CSIEStyl(s).zIndex);
  436.     else return (CSNSStyl(s).zIndex);
  437. }
  438. CSSeqArray = new Array;
  439. function CSSeqActionFct(seq,loopCount,continueLoop) {
  440.     if ((seq.loop < 2) || ((loopCount % 2) != 0)) {
  441.         for (var i=0;i<seq.actionCount;i++) {
  442.             if (seq.actions[3*i + 1] <= seq.frame) {
  443.                 if ((loopCount > 1) && (seq.actions[3*i + 1] < seq.start)) continue;
  444.                 if (seq.actions[3*i + 2] < loopCount) {
  445.                     seq.actions[3*i + 2] = loopCount; CSLoopIsRunning = true;
  446.                     CSAction(new Array(seq.actions[3*i + 0])); continueLoop = true;
  447.                 }
  448.             } else { continueLoop = true; break; }
  449.         }
  450.     } else {
  451.         for (var i=seq.actionCount-1;i>=0;i--) {
  452.             if (seq.actions[3*i + 1] > seq.frame) {
  453.                 if (seq.actions[3*i + 1] > seq.end) continue;
  454.                 if (seq.actions[3*i + 2] < loopCount) {
  455.                     seq.actions[3*i + 2] = loopCount; CSLoopIsRunning = true;
  456.                     CSAction(new Array(seq.actions[3*i + 0])); continueLoop = true;
  457.                 }
  458.             } else { continueLoop = true; break; }
  459.         }
  460.     }
  461.     return continueLoop;
  462. }        
  463. function CSSeqFunction(fctInfo)
  464. {
  465.     var seq = fctInfo.data; var oldFrame = seq.frame;
  466.     var newTicks = (new Date()).getTime();
  467.     seq.frame = Math.round((seq.fps * (newTicks - seq.startTicks)/1000.0) - 0.5);
  468.     var continueLoop  = false; var loopCount = 1;
  469.     
  470.     if (seq.loop > 0) {
  471.         continueLoop = true;
  472.         if (seq.loop == 1) {
  473.             var iv = (seq.end - seq.start);
  474.             var f = Math.round(((seq.frame - seq.start) / iv) - 0.5);
  475.             if (f < 0) f = 0;
  476.             loopCount = f+1;
  477.             seq.frame = seq.start + ((seq.frame - seq.start) % (seq.end - seq.start));
  478.         } else {
  479.             var iv = (seq.end - seq.start);
  480.             var f = Math.round(((seq.frame - seq.start) / iv) - 0.5);
  481.             if (f < 0) f = 0;
  482.             loopCount = f+1;
  483.             f = (seq.frame - seq.start) % (2 * iv);
  484.             if (f > iv) f = 2*iv - f;
  485.             seq.frame = seq.start + f;
  486.         }
  487.     }
  488.     continueLoop = CSSeqActionFct(seq,loopCount,continueLoop);
  489.     for (var i=0;i<seq.tracks.length;i++) {
  490.         var track = seq.tracks[i]; var frameCount = 0; var lastCount = 0; var partCount = 0;
  491.         var partIdx = track.parts.ticks.length;
  492.         for (var k=0;k<track.parts.ticks.length;k++) {
  493.             frameCount += track.parts.ticks[k];
  494.             if (frameCount > seq.frame) { partIdx = k; partCount = seq.frame - lastCount; break; }
  495.             lastCount = frameCount;
  496.         }
  497.         if (partIdx < track.parts.ticks.length) {
  498.             var type=track.parts.moveType[partIdx];
  499.             if(type==1) CSSetLinearPos (track, partIdx, partCount);
  500.             else if(type==2) CSSetCurvePos (track, partIdx, partCount);
  501.             else if(type==3) if (oldFrame != seq.frame) CSSetRandomPos (track, partIdx, partCount);
  502.                              else { x = CSGetStylePos(track.layer,0); y = CSGetStylePos(track.layer,1); }
  503.             CSSetStyleVis(track.layer,track.parts.visibilities[partIdx]);
  504.             CSSetStyleDepth(track.layer,track.parts.depths[partIdx]);
  505.             continueLoop = true;
  506.         } else {
  507.             var partIdx = track.parts.moveType.length-1;
  508.             var posArray = track.parts.positions;
  509.             var x = posArray[partIdx * 6 + 0]; var y = posArray[partIdx * 6 + 1];
  510.             CSSetStylePos(track.layer,0,x); CSSetStylePos(track.layer,1,y);
  511.             CSSetStyleVis(track.layer,track.parts.visibilities[partIdx]);
  512.             CSSetStyleDepth(track.layer,track.parts.depths[partIdx]);
  513.         }
  514.     }
  515.     return continueLoop;
  516. }
  517. function CSSetLinearPos (track, partIdx, partCount) {
  518.     var curTicks = track.parts.ticks[partIdx];
  519.     var pIdx1 = partIdx * 6; var pIdx2 = (partIdx+1) * 6;
  520.     var posArray = track.parts.positions;
  521.     var x = posArray[pIdx1 + 0]; var y = posArray[pIdx1 + 1];
  522.     var x1,x2,y1,y2;
  523.     var factor = partCount/curTicks;
  524.     x1 = x; y1 = y;
  525.     x2 = posArray[pIdx2 + 0]; y2 = posArray[pIdx2 + 1];
  526.     x = x1 * (1-factor) + x2 * factor; y = y1 * (1-factor) + y2 * factor;
  527.     CSSetStylePos(track.layer,0,x); CSSetStylePos(track.layer,1,y);
  528. }
  529. function CSSetCurvePos (track, partIdx, partCount) {
  530.     var curTicks = track.parts.ticks[partIdx];
  531.     var pIdx1 = partIdx * 6; var pIdx2 = (partIdx+1) * 6;
  532.     var posArray = track.parts.positions;
  533.     var x = posArray[pIdx1 + 0]; var y = posArray[pIdx1 + 1];
  534.     var x1,x2,x3,x4,y1,y2,y3,y4;
  535.     var factor = partCount/curTicks;
  536.     var t = factor; var u = t * t; var v = u * t;
  537.     var val1 = 3*(u-t) - v + 1; var val2 = 3*(v+t - 2*u); var val3 = 3*(u-v); var val4 = v;
  538.     x1 = x; y1 = y; x2 = posArray[pIdx1 + 2]; y2 = posArray[pIdx1 + 3];
  539.     x3 = posArray[pIdx1 + 4]; y3 = posArray[pIdx1 + 5];
  540.     x4 = posArray[pIdx2 + 0]; y4 = posArray[pIdx2 + 1];
  541.     x = x1 * val1 + x2 * val2 + x3 * val3 + x4 * val4;
  542.     y = y1 * val1 + y2 * val2 + y3 * val3 + y4 * val4;
  543.     CSSetStylePos(track.layer,0,x); CSSetStylePos(track.layer,1,y);
  544. }
  545. function CSSetRandomPos (track, partIdx, partCount) {
  546.     var curTicks = track.parts.ticks[partIdx];
  547.     var pIdx1 = partIdx * 6; var pIdx2 = (partIdx+1) * 6;
  548.     var posArray = track.parts.positions;
  549.     var x = posArray[pIdx1 + 0]; var y = posArray[pIdx1 + 1];
  550.     var x1,x2,y1,y2;
  551.     var factor = partCount/curTicks;
  552.     x1 = x; y1 = y;
  553.     x2 = posArray[pIdx2 + 0]; y2 = posArray[pIdx2 + 1];
  554.     var factorx = Math.random(); var factory = Math.random();
  555.     x = x1 * (1-factorx) + x2 * factorx; y = y1 * (1-factory) + y2 * factory;
  556.     CSSetStylePos(track.layer,0,x); CSSetStylePos(track.layer,1,y);
  557. }
  558. function CSStartSeq(name) {
  559.     var seq = CSGetScene(name); var date = new Date()
  560.     seq.startTicks = date.getTime()
  561.     for (var i=0;i<seq.actionCount;i++) seq.actions[3*i+2] = 0;
  562.     CSStartFunction(CSSeqFunction,seq);
  563. }
  564. function CSSceneObj (name,fps,loop,start,end,frame,sTicks,numAct,acts,tracks) {
  565.     this.name=name;this.fps=fps;this.loop=loop;this.start=start;this.end=end;
  566.     this.frame=frame;this.startTicks=sTicks;this.actionCount=numAct;
  567.     this.actions=acts;this.tracks=tracks;
  568. }
  569. function CSTrackObj (name,partIdx,partCount,parts) {
  570.     this.layer=name;this.partIdx=partIdx;this.partCount=partCount;this.parts=parts;
  571. }
  572. function CSPartObj (ticks,pos,depths,vis,moveType) {
  573.     this.ticks=ticks;this.positions=pos;this.depths=depths;this.visibilities=vis;
  574.     this.moveType=moveType;
  575. }
  576. function CSGetScene (name) {
  577.     for (i=0;i<CSSeqArray.length;i++) { var seq = CSSeqArray[i]; if (seq.name==name) return seq; }
  578.     return 0;
  579. }
  580. function CSAutoStartScene(action) { CSStartSeq (action[1]); }
  581. /* -- Action Functions */
  582. function CSActionGroup (action) {
  583.     for(var i=1;i<action.length;i++) { CSAction(new Array(action[i])); }
  584. }
  585. function ROAddToNowPlayingList (act) {
  586.     var i,url,clipinfo,related_info_url,width,height,media_browser_url,target;
  587.     url=act[1];
  588.     related_info_url=act[2];
  589.     if(related_info_url=="(EmptyReference!)")related_info_url="";
  590.     width=act[3];
  591.     height=act[4];
  592.     media_browser_url=act[5];
  593.     if(media_browser_url=="(EmptyReference!)")media_browser_url="";
  594.     if(act[6]==0)target="_rpbrowser";
  595.     else target="_rpexternal";
  596.     clipinfo="Album name="+act[7];
  597.     clipinfo+="|Artist name="+act[8];
  598.     clipinfo+="|CDNum="+act[9];
  599.     clipinfo+="|Comments="+act[10];
  600.     clipinfo+="|Genre="+act[11];
  601.     clipinfo+="|Language="+act[12];
  602.     clipinfo+="|Mood="+act[13];
  603.     clipinfo+="|Preference="+act[14];
  604.     clipinfo+="|Situation="+act[15];
  605.     clipinfo+="|Title="+act[16];
  606.     clipinfo+="|Year="+act[17];
  607.     window.parent.external.AddToNowPlaying (url, clipinfo, related_info_url, width, height, media_browser_url, target);
  608. }
  609. function CSCallAction(action)
  610. {
  611.     CSAction(new Array(action[1]));
  612. }
  613. function CSCallFunction(action)
  614. {
  615.     var str = action[1];
  616.     str += "(";
  617.     str += action[2];
  618.     str += ");"
  619.     return eval(str);
  620. }
  621. function ROClearNowPlayingList (act) {
  622.     window.parent.external.ClearNowPlaying();
  623. }
  624. function CSCloseWindow() { 
  625. if (self.parent.frames.length != 0) {
  626.     self.parent.close()    
  627.     } else {
  628.     window.close()
  629.     }
  630. }
  631. function CSConditionAction(action) {
  632.     if (action[1]) {
  633.         if (CSAction(new Array(action[1])) == true) {
  634.             if (action[2]) CSAction(new Array(action[2]));
  635.         } else if (action[3]) CSAction(new Array(action[3]));
  636.     }
  637. }
  638. function WBConfirmLink(action) {
  639.      if (checkIt(action)) {
  640.          if (action[2] != "(Empty Reference!)" && action[2] != "(EmptyReference!)") {
  641.              if (action[3].length < 1) {
  642.                 parent.location.href=action[2];
  643.             }
  644.             else {
  645.                 parent.frames[action[3]].location.href=action[2];
  646.             }
  647.         }
  648.     }
  649.     return;
  650. }
  651. function checkIt(action) {
  652.     var carryOn = window.confirm(action[1]);
  653.     return carryOn;
  654.     }
  655. function initIArray() {
  656. this.length = initIArray.arguments.length;
  657. for (var i = 0; i < this.length; i++)
  658. this[i+1] = initIArray.arguments[i]; 
  659. }
  660. function dailyImageURL(action) {
  661. var dateArray = new
  662. initIArray("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
  663. var today = new Date();
  664. var day = dateArray[today.getDay()];
  665. if (today.getDay() == 0) { day = "Sunday"; }
  666. var img = null;
  667. if (document.images) {
  668.     if (!IsIE()&&CSBVers<5) img = CSFindElement(action[1],0);
  669.     else img = document.images[action[1]];
  670.         if (img) {
  671.             if (day == "Monday" && action[2] != "(Empty Reference!)" && action[2] != "(EmptyReference!)") img.src = action[2]
  672.             if (day == "Tuesday" && action[3] != "(Empty Reference!)" && action[3] != "(EmptyReference!)") img.src = action[3]
  673.             if (day == "Wednesday" && action[4] != "(Empty Reference!)" && action[4] != "(EmptyReference!)") img.src = action[4]
  674.             if (day == "Thursday" && action[5] != "(Empty Reference!)" && action[5] != "(EmptyReference!)") img.src = action[5]
  675.             if (day == "Friday" && action[6] != "(Empty Reference!)" && action[6] != "(EmptyReference!)") img.src = action[6]
  676.             if (day == "Saturday" && action[7] != "(Empty Reference!)" && action[7] != "(EmptyReference!)") img.src = action[7]
  677.             if (day == "Sunday" && action[8] != "(Empty Reference!)" && action[8] != "(EmptyReference!)") img.src = action[8]
  678.         }  
  679. }  
  680. }
  681. function initArray() {
  682. this.length = initArray.arguments.length;
  683. for (var i = 0; i < this.length; i++)
  684. this[i+1] = initArray.arguments[i]; 
  685. }
  686. function dailyRedirect(action) {
  687. var dateArray = new
  688. initArray("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
  689. var today = new Date();
  690. var day = dateArray[today.getDay()];
  691. if (today.getDay() == 0) { day = "Sunday"; }
  692. if (day == "Monday" && action[1] != "(Empty Reference!)" && action[1] != "(EmptyReference!)") window.location = action[1]
  693. if (day == "Tuesday" && action[2] != "(Empty Reference!)" && action[2] != "(EmptyReference!)") window.location = action[2]
  694. if (day == "Wednesday" && action[3] != "(Empty Reference!)" && action[3] != "(EmptyReference!)") window.location = action[3]
  695. if (day == "Thursday" && action[4] != "(Empty Reference!)" && action[4] != "(EmptyReference!)") window.location = action[4]
  696. if (day == "Friday" && action[5] != "(Empty Reference!)" && action[5] != "(EmptyReference!)") window.location = action[5]
  697. if (day == "Saturday" && action[6] != "(Empty Reference!)" && action[6] != "(EmptyReference!)") window.location = action[6]
  698. if (day == "Sunday" && action[7] != "(Empty Reference!)" && action[7] != "(EmptyReference!)") window.location = action[7]
  699. }
  700. function CSDeleteCookie(action) 
  701. {
  702. var name=action[1]
  703. var value=action[2]
  704. var jours=-12000
  705. path="/"
  706. domain=null
  707. var expdate = new Date ();
  708. expdate.setTime (expdate.getTime() + (jours * 60 * 60 * 1000));
  709. SetCookie(name,value,expdate)
  710. }
  711. function SetCookie (name, value) {
  712.   var argv = SetCookie.arguments;
  713.   var argc = SetCookie.arguments.length;
  714.   var expires = (argc > 2) ? argv[2] : null;
  715.   var secure = (argc > 5) ? argv[5] : false;
  716.   document.cookie = name + "=" + escape (value) +
  717.     ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
  718.     ((path == null) ? "" : ("; path=" + path)) +
  719.     ((domain == null) ? "" : ("; domain=" + domain)) +
  720.     ((secure == true) ? "; secure" : "");
  721. }
  722. function CSDocWrite(action) { document.write(action[1]); }
  723. var gCSIEDragObject = null;
  724. var gDragX,gDragY;
  725. function CSSetupDrag (layerName) {
  726.     this.x = 0; this.y = 0;
  727.     if (IsIE()) {
  728.         this.canDrag=true; 
  729.         this.layerObj=document.all.tags("div")[layerName];
  730.         this.layerObj.dragObj = this;
  731.         document.ondragstart = CSIEStartDrag;
  732.         document.onmousedown = CSIEMouseDown;
  733.         document.onmouseup = CSIEStopDrag;
  734.     } else {
  735.         if (CSBVers>=5)
  736.             {
  737.             this.layerObj=document.getElementById(layerName);
  738.             this.layerObj.addEventListener("mousedown", CSNS6StartDrag, true);
  739.             this.layerObj.addEventListener("mouseup", CSNS6StopDrag, true);
  740.             }
  741.         else
  742.             {
  743.             this.layer=CSNSStyl(layerName);this.onmousemove=null; 
  744.             this.layer.document.theLayer=this;
  745.             this.layer.document.captureEvents(Event.MOUSEDOWN);
  746.             this.layer.document.onmousedown=CSNSStartDrag; 
  747.             this.layer.document.onmouseup=CSNSStopDrag;
  748.             }
  749.     }
  750. }
  751. function CSNS6StartDrag (ev) {
  752.     CSIDOM();
  753.     ev.currentTarget.addEventListener("mousemove", CSNS6DoDrag, true);
  754.     gDragX=ev.clientX;
  755.     gDragY=ev.clientY;
  756.     ev.preventDefault();
  757. }
  758. function CSNS6DoDrag (ev) {
  759.     var style=ev.currentTarget.style;
  760.     style.left = parseInt(style.left)+(ev.clientX-gDragX)+"px";
  761.     style.top = parseInt(style.top)+(ev.clientY-gDragY)+"px";
  762.     gDragX=ev.clientX;
  763.     gDragY=ev.clientY;
  764. }
  765. function CSNS6StopDrag (ev) {    
  766.     ev.target.removeEventListener("mousedown", CSNS6StartDrag, true);
  767.     ev.target.removeEventListener("mouseup", CSNS6StopDrag, true);
  768.     ev.currentTarget.removeEventListener("mousemove", CSNS6DoDrag, true);
  769.     ev.preventDefault();
  770. }
  771. function CSNSStartDrag (ev) {
  772.     var clickInMe = false;
  773.     if (ev.target != this) {
  774.         for (var i=0;i<this.images.length;i++) {
  775.             if (this.images[i] == ev.target) { clickInMe = true; break;}
  776.             }
  777.         }
  778.     else clickInMe = true;    
  779.     if (clickInMe)
  780.         {
  781.         this.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP); 
  782.         this.onmousemove=CSNSDoDrag;
  783.         this.theLayer.x= ev.pageX;
  784.         this.theLayer.y= ev.pageY;
  785.         this.routeEvent(ev);
  786.         return false;
  787.         }
  788.    this.onmousemove=null;this.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);
  789.     this.routeEvent(ev);
  790.    return true; 
  791. }
  792. function CSNSStopDrag (ev) {
  793.    this.onmousemove=null;this.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);return false; 
  794. }
  795. function CSNSDoDrag (ev) {
  796.     this.theLayer.layer.moveBy(ev.pageX-this.theLayer.x, ev.pageY-this.theLayer.y); 
  797.     this.theLayer.x = ev.pageX; 
  798.     this.theLayer.y = ev.pageY;
  799.     this.routeEvent(ev);
  800. }
  801. function CSIEStartDrag () {
  802.     if(gCSIEDragObject != null && (gCSIEDragObject.tagName==event.srcElement.tagName))
  803.         event.returnValue=false;  
  804. }
  805. function CSIEStopDrag () { gCSIEDragObject=null; document.onmousemove=null; }
  806. function CSIEMouseDown () {
  807.     if(event.button==1) {
  808.         dragLayer = event.srcElement;
  809.         while (dragLayer!=null) 
  810.             {
  811.             if ((dragLayer.dragObj == null) && (dragLayer.tagName == "DIV"))
  812.                 break;
  813.             if (dragLayer.dragObj != null)
  814.                 break;
  815.             dragLayer=dragLayer.parentElement;
  816.             }
  817.             
  818.         if (dragLayer == null) return;
  819.         if (dragLayer.dragObj!=null && dragLayer.dragObj.canDrag) {
  820.             gCSIEDragObject = dragLayer;
  821.             gCSIEDragObject.dragObj.x=event.clientX;
  822.             gCSIEDragObject.dragObj.y=event.clientY;
  823.             document.onmousemove = CSIEMouseMove;
  824.         }
  825.     }
  826. }
  827. function CSIEMouseMove () {
  828.     gCSIEDragObject.dragObj.layerObj.style.pixelLeft+=(event.clientX-gCSIEDragObject.dragObj.x);
  829.     gCSIEDragObject.dragObj.layerObj.style.pixelTop+=(event.clientY-gCSIEDragObject.dragObj.y);
  830.     gCSIEDragObject.dragObj.x=event.clientX;
  831.     gCSIEDragObject.dragObj.y=event.clientY;
  832.     event.returnValue = false;
  833.     event.cancelBubble = true;
  834. }
  835. var gDragArray = new Array();
  836. function CSDrag(action) { gDragArray[gDragArray.length] = new CSSetupDrag(action[1]); }
  837. function ROEmbeddedActions (act) {
  838.     var fct,i,j,name,nsemb;
  839.     name=act[1];
  840.     if (!IsIE())nsemb = ROFindEmbed(name);
  841.        if(act[2]!="") {
  842.         fct=act[2]; fct+="(";
  843.         if(act[3]==undefined)
  844.             fct+=")";
  845.         for(i=3; i<act.length; i++) {
  846.             fct+="\'"; fct+=act[i]; fct+="\'";
  847.             if(i==act.length-1)fct+=")";
  848.             else fct+=",";
  849.         }
  850.     }
  851.     if(IsIE()) return eval(name+"."+fct);
  852.     else {
  853.         if(nsemb) return nsemb.eval(fct);
  854.     }
  855. }
  856. function CSFieldValidate(action) { 
  857. var form = action[1];
  858. var elem = action[2];
  859. var theEntry  = document.forms[form].elements[elem].value
  860. var theFormElem = document.forms[form].elements[elem]
  861. var badEntry = ""
  862.     function theAlert () { 
  863.     alert(action[6]);
  864.     theFormElem.select();
  865.     theFormElem.focus();
  866.     }      
  867.     function isEmpty() { 
  868.         if (theEntry == "") { 
  869.         theAlert()
  870.         }     
  871.     }
  872.     function isNumber() { 
  873.             if (theEntry == "") { 
  874.             theAlert()
  875.             }         
  876.         for (i=0; i<theEntry.length; i++) {  
  877.             if (theEntry.charAt(i) < "0" || theEntry.charAt(i) > "9") {  
  878.                 badEntry = "notnumber"
  879.                 } 
  880.             }          
  881.         if (badEntry == "notnumber") {
  882.         theAlert()    
  883.         }    
  884.     } 
  885.         
  886.     function isAlpha() { 
  887.             if (theEntry == "") { 
  888.             theAlert()
  889.             }         
  890.         for (i=0; i<theEntry.length; i++) {  
  891.             if (theEntry.charAt(i) >= "0" && theEntry.charAt(i) <= "9") {  
  892.                 badEntry = "notalpha"
  893.                 } 
  894.             }          
  895.         if (badEntry == "notalpha") {
  896.         theAlert()    
  897.         }    
  898.     } 
  899.                 
  900.     function requiredChars() {
  901.     numofChars = theEntry.length
  902.         if (numofChars != action[4]) {
  903.             theAlert()
  904.         } 
  905.     }    
  906.     function exactString() {
  907.         if (theEntry != action[5]) {
  908.             theAlert()
  909.         } 
  910.     }    
  911.     
  912.     function validEmail() {
  913.         invalidChars = " /:,;"        
  914.         if (theEntry == "") { 
  915.             badEntry = "badEmail"
  916.             }
  917.         for (i=0; i < 5; i++)  {
  918.             badChar = invalidChars.charAt(i)
  919.                 if (theEntry.indexOf(badChar,0) > -1) {
  920.                 badEntry = "badEmail"
  921.                 }
  922.         }    
  923.     atsignLoc = theEntry.indexOf("@",1)
  924.         if (atsignLoc == -1) {
  925.             badEntry = "badEmail"
  926.         }        
  927.         if (theEntry.indexOf("@",atsignLoc+1) > -1) {
  928.         badEntry = "badEmail"
  929.         }
  930.     dotLoc = theEntry.indexOf(".",atsignLoc)
  931.         if (dotLoc == -1) {
  932.         badEntry = "badEmail"
  933.         }
  934.         if (dotLoc+3 > theEntry.length) {
  935.         badEntry = "badEmail"
  936.         }
  937.         if (badEntry == "badEmail") {
  938.         theAlert()
  939.         }
  940.     }
  941.     function validCC() { 
  942.     var theNumber = new Array(theEntry.length);
  943.     var i = 0
  944.     var total = 0
  945.         for (i = 0; i < theEntry.length; ++i) {
  946.         theNumber[i] = parseInt(theEntry.charAt(i))
  947.         }
  948.         for (i = theNumber.length -2; i >= 0; i-=2) {  
  949.         theNumber[i] *= 2;                             
  950.         if (theNumber[i] > 9) theNumber[i]-=9;             
  951.         }                                         
  952.         for (i = 0; i < theNumber.length; ++i) {
  953.         total += theNumber[i];                         
  954.         }    
  955.         isinteger = total/10
  956.         if(parseInt(isinteger)!=isinteger) {
  957.         theAlert()
  958.         }
  959.     }
  960.     
  961. var type=action[3];
  962. if(type==0) isEmpty()
  963. else if(type==1) isNumber()
  964. else if(type==2) isAlpha()
  965. else if(type==3) requiredChars()
  966. else if(type==4) exactString()
  967. else if(type==5) validEmail()
  968. else if(type==6) validCC()
  969. }
  970.         
  971. function CSFlipMove(action) {
  972.     if (action[1] == '') return;
  973.     var curX = CSGetStylePos(action[1],0); var curY = CSGetStylePos(action[1],1);
  974.     var x1 = action[2][0];
  975.     var y1 = action[2][1];
  976.     if ((x1 != curX) || (y1 != curY)) CSSlideLayer(action[1],action[2],action[4],action[5]);
  977.     else CSSlideLayer(action[1],action[3],action[4],action[5]);
  978. }
  979. if (navigator.appName == "Netscape" && navigator.appVersion.charAt(0) >=5) {
  980.     leftH = ".left";
  981.     topV = ".top";
  982.     nndoc = "document.getElementById(layername).style";
  983.     iestyle = "";
  984.     offsetH = "window.pageXOffset";
  985.     offsetV = "window.pageYOffset";
  986.     } 
  987.     
  988.     else if (navigator.appName == "Netscape" && navigator.appVersion.charAt(0) >=4) {
  989.     leftH = ".left";
  990.     topV = ".top";
  991.     nndoc = "document.";
  992.     iestyle = "";
  993.     offsetH = "window.pageXOffset";
  994.     offsetV = "window.pageYOffset";    
  995.     } 
  996.     
  997.     else if (navigator.appName == "Microsoft Internet Explorer") {
  998.     leftH = ".pixelLeft";
  999.     topV = ".pixelTop";
  1000.     nndoc = "";
  1001.     iestyle = "document.getElementById(layername).style";
  1002.     offsetH = "document.body.scrollLeft";
  1003.     offsetV = "document.body.scrollTop";
  1004.     }
  1005. function getnewPos() {
  1006. var currentH = eval(offsetH);
  1007. var currentV = eval(offsetV);
  1008. x = parseInt(currentH) + parseInt(xpos);
  1009. y = parseInt(currentV) + parseInt(ypos);
  1010. moveLayer();
  1011. setTimeout("getnewPos()",10)
  1012. }
  1013. function CSFloatLayer(action) {
  1014. layername = action[1];
  1015. ypos = action[2];
  1016. xpos = action[3];
  1017. if (navigator.appVersion.charAt(0) >=5 || navigator.appName == "Microsoft Internet Explorer") {
  1018.     leftPos = eval(nndoc + iestyle + leftH);
  1019.     topPos = eval(nndoc + iestyle + topV);
  1020.     } else {
  1021.     leftPos = eval(nndoc + layername + iestyle + leftH);
  1022.     topPos = eval(nndoc + layername + iestyle + topV);
  1023.     }
  1024.     getnewPos()
  1025.     }
  1026. function moveLayer() {
  1027. if (navigator.appVersion.charAt(0) >=5  || navigator.appName == "Microsoft Internet Explorer") {
  1028.     eval(nndoc + iestyle + topV + "=" + y);
  1029.     eval(nndoc + iestyle + leftH + "=" + x);
  1030.     } else {
  1031.     eval(nndoc + layername + iestyle + topV + "=" + y);
  1032.     eval(nndoc + layername + iestyle + leftH + "=" + x);
  1033.     }
  1034. }
  1035. function frameP(action) {
  1036.         if(parent.frames.length==0) {
  1037.             var fileName=window.location.href.substring(window.location.href.lastIndexOf("/")+1,window.location.href.length);
  1038.             window.location.href=action[1]+"?"+action[2]+"="+fileName;
  1039.         } else {
  1040.             if(top.location.search!="") {
  1041.                 var sFrame=top.location.search.substring(1,top.location.search.indexOf("="));
  1042.                 if(name==sFrame) {
  1043.                     var sName=top.location.search.substring(top.location.search.indexOf("=")+1,top.location.search.length);
  1044.                     var fileName=window.location.href.substring(window.location.href.lastIndexOf("/")+1,window.location.href.length);
  1045.                     if(fileName!=sName) {
  1046.                         location=sName;
  1047.                     }
  1048.                 }
  1049.             }
  1050.         }
  1051.     }
  1052. function ROGetClipInfo (act) {
  1053.     var property,type;
  1054.     type=act[1];
  1055.     if(type==0)property="Album name";
  1056.     else if(type==1)property="Artist name";
  1057.     else if(type==2)property="CDNum";
  1058.     else if(type==3)property="Comments";
  1059.     else if(type==4)property="Genre";
  1060.     else if(type==5)property="Language";
  1061.     else if(type==6)property="Mood";
  1062.     else if(type==7)property="Preference";
  1063.     else if(type==8)property="Situation";
  1064.     else if(type==9)property="Title";
  1065.     else if(type==10)property="Year";
  1066.     else return "";
  1067.     return window.parent.external.GetClipInfo (property);
  1068. }
  1069. function CSGetFormElementValue(action) { 
  1070.     var form = action[1];
  1071.     var elem = action[2];
  1072.     return document.forms[form].elements[elem].value;
  1073. }
  1074. function ROGetInstalledComponents() {
  1075.     return window.parent.external.InstalledComponents;
  1076. }
  1077. function CSGetLayerPos(action) { 
  1078.     var layer = action[1];
  1079.     var x        = CSGetStylePos(layer, 0);
  1080.     var y        = CSGetStylePos(layer, 1);
  1081.     return new Array(x, y);
  1082. }
  1083. function ROGetPlayerProperty (act) {
  1084.     var property,type;
  1085.     type=act[1];
  1086.     if(type==0)property="APIVERSION";
  1087.     else if(type==1)property="BANDWIDTH";
  1088.     else if(type==2)property="COUNTRYID";
  1089.     else if(type==3)property="DISTRIBUTION";
  1090.     else if(type==4)property="INSTALLPATH";
  1091.     else if(type==5)property="LANGUAGEID";
  1092.     else if(type==6)property="LANGUAGEPREFERENCE";
  1093.     else if(type==7)property="OSNAME";
  1094.     else if(type==8)property="PRODUCTNAME";
  1095.     else if(type==9)property="PRODUCTVERSION";
  1096.     else if(type==10)property="REGIONDATE";
  1097.     else return "";
  1098.     return window.parent.external.PlayerProperty(property);
  1099. }
  1100. function ROGetPlayerState() {
  1101.     var result,state;
  1102.     state=window.parent.external.GetPlayerState();
  1103.     switch(state) {
  1104.         case 0:
  1105.             result="Stopped";break;
  1106.         case 1:
  1107.             result="Contacting";break;
  1108.         case 2:
  1109.             result="Buffering";break;
  1110.         case 3:
  1111.             result="Playing";break;
  1112.         case 4:
  1113.             result="Paused";break;
  1114.         case 5:
  1115.             result="Seeking";break;
  1116.         default:
  1117.             result="";break;
  1118.     }
  1119.     return result;
  1120. }
  1121. function ROGetVersionNumber (act) {
  1122.     var comp,min,max,result,type,unpack;
  1123.     type=act[1];
  1124.     if(type==0 && act[2]=="") {
  1125.         result=window.parent.external.RealPlayerVersion;
  1126.     }
  1127.     else {
  1128.         if(type==1)comp="audp";
  1129.         else if(type==2)comp="DBCMpg1";
  1130.         else if(type==3)comp="Flash";
  1131.         else if(type==4)comp="GF";
  1132.         else if(type==5)comp="GFJP";
  1133.         else if(type==6)comp="imgp";
  1134.         else if(type==7)comp="MP3PL";
  1135.         else if(type==8)comp="MPGA";
  1136.         else if(type==9)comp="PNG";
  1137.         else if(type==10)comp="RA";
  1138.         else if(type==11)comp="RealTxt";
  1139.         else if(type==12)comp="RichFX";
  1140.         else if(type==13)comp="RPix";
  1141.         else if(type==14)comp="RV";
  1142.         else if(type==15)comp="sdp";
  1143.         else if(type==16)comp="vidp";
  1144.         if(act[2]!="")comp=act[2];
  1145.         max=act[3];
  1146.         min=act[4];
  1147.         result=window.parent.external.ComponentVersion (comp+":"+max+"."+min);
  1148.     }
  1149.     unpack=act[5];
  1150.     if(unpack)
  1151.         result=ROUnpackVersionNumber (result);
  1152.     return result;
  1153. }
  1154. function CSGoBack1() { history.back() }
  1155. function CSGotoLink(action) {
  1156.     if (action[2].length) {
  1157.         var hasFrame=false;
  1158.         for(i=0;i<parent.frames.length;i++) { if (parent.frames[i].name==action[2]) { hasFrame=true; break;}}
  1159.         if (hasFrame==true)
  1160.             parent.frames[action[2]].location = action[1];
  1161.         else
  1162.             window.open (action[1],action[2],"");
  1163.     }
  1164.     else location = action[1];
  1165. }
  1166. function ROHandleAction (act) {
  1167.     var str,type;
  1168.     type=act[1];
  1169.     if(type==0)str="CD";
  1170.     else if(type==1)str="MyDevices";
  1171.     else if(type==2)str="NowPlaying";
  1172.     else if(type==3)str="Radio";
  1173.     else if(type==4)str="ShowEqualizer";
  1174.     else if(type==5)str="Web";
  1175.     else return;
  1176.     window.parent.external.HandleAction(str);
  1177. }
  1178. function CSIdleObject (action) {
  1179.     this.conditionAction = action[2];
  1180.     this.trueAction = action[3];
  1181.     this.falseAction = action[4];
  1182.     this.exitIdleIfTrue = action[1];
  1183.     this.lastState = false;
  1184. }
  1185. function CSIdleAction(action) {
  1186.     idleObj = new CSIdleObject (action);
  1187.     CSStartFunction (CSDoIdle,idleObj);
  1188. }
  1189. function CSDoIdle (param) {
  1190.     idleObject=param.data;
  1191.     if (idleObject.conditionAction) {
  1192.         gCurrentIdleObject = idleObject;
  1193.         var result = CSAction(new Array(idleObject.conditionAction));
  1194.         if (result == true && idleObject.lastState==false) {
  1195.             idleObject.lastState = result;
  1196.             if (idleObject.trueAction) {
  1197.                 CSAction(new Array(idleObject.trueAction));
  1198.                 if (idleObject.exitIdleIfTrue == true) return false;
  1199.             }
  1200.         } else if (result == false && idleObject.lastState == true) {
  1201.             idleObject.lastState = false;
  1202.             if (idleObject.falseAction) {
  1203.                 CSAction(new Array(idleObject.falseAction));
  1204.             }        
  1205.         }
  1206.     }
  1207.     return true;
  1208. }
  1209. function CSLayerIntersect (condition)
  1210. {
  1211.     var l1,t1,r1,b1,l2,t2,r2,b2;
  1212.     if (IsIE()) {
  1213.         var layer1=document.all.tags("div")[condition[1]];
  1214.         var layer2=document.all.tags("div")[condition[2]];
  1215.         l1=layer1.style.pixelLeft; t1=layer1.style.pixelTop; r1=layer1.offsetWidth+l1; b1=layer1.offsetHeight+t1;
  1216.         l2=layer2.style.pixelLeft; t2=layer2.style.pixelTop; r2=layer2.offsetWidth+l2; b2=layer2.offsetHeight+t2;    
  1217.     } else {
  1218.         var layer1=CSNSStyl(condition[1]);
  1219.         var layer2=CSNSStyl(condition[2]);
  1220.         if (CSBVers>=5)
  1221.             {
  1222.             CSIDOM();
  1223.             l1=parseInt(layer1.left); t1=parseInt(layer1.top); r1=parseInt(layer1.width)+l1; b1=parseInt(layer1.height)+t1;
  1224.             l2=parseInt(layer2.left); t2=parseInt(layer2.top); r2=parseInt(layer2.width)+l2; b2=parseInt(layer2.height)+t2;
  1225.             }
  1226.         else
  1227.             {
  1228.             l1=layer1.x; t1=layer1.y; r1=layer1.clip.width+l1; b1=layer1.clip.height+t1;
  1229.             l2=layer2.x; t2=layer2.y; r2=layer2.clip.width+l2; b2=layer2.clip.height+t2;
  1230.             }
  1231.     }
  1232.     var w = (r1 < r2 ? r1 : r2) - (l1 > l2 ? l1 : l2)
  1233.     var h = (b1 < b2 ? b1 : b2) - (t1 > t2 ? t1 : t2)
  1234.     return ((w >= 0) && (h >= 0));
  1235. }
  1236. CSCurrentPressedKey = -1;
  1237. function CSKeyPress(ev) {
  1238.     var code;
  1239.     if(IsIE()) CSCurrentPressedKey = event.keyCode;
  1240.     else CSCurrentPressedKey = ev.which;
  1241. }
  1242. document.onkeypress    = CSKeyPress;
  1243. function CSKeyCompare(condition)
  1244. {
  1245.     var eq = (condition[1] == CSCurrentPressedKey);
  1246.     if(eq)
  1247.         CSCurrentPressedKey = -1;
  1248.     return eq;
  1249. }
  1250. function CSPAKkillframe() { 
  1251. if (self.parent.frames.length != 0)
  1252. self.parent.location = document.location
  1253. }
  1254. var myLayer = false;
  1255. var offSetX = 1;
  1256. var offSetY = 1;
  1257. function CSMouseFollow(action,offX,offY){
  1258.     myLayer = action[1];
  1259.     if(offX){offSetX=offX;}
  1260.     if(offY){offSetY=offY;}
  1261.     if (navigator.appName == "Netscape") {
  1262.         document.captureEvents(Event.MOUSEMOVE);
  1263.     } else {
  1264.         if(navigator.appVersion.indexOf("Mac")!=-1){offSetX=offSetX-18;}
  1265.     }
  1266.     document.onmousemove = mouseLayer;
  1267. }
  1268. function mouseLayer(e){
  1269.     if (navigator.appName == "Netscape" && navigator.appVersion.charAt(0) >=5) {
  1270.         document.getElementById(myLayer).style.left = (e.pageX+offSetX);
  1271.         document.getElementById(myLayer).style.top = (e.pageY+offSetY); 
  1272.         }
  1273.         else if (navigator.appName == "Netscape") {
  1274.             document.layers[myLayer].moveBy(
  1275.             (e.pageX+offSetX) - document.layers[myLayer].left, 
  1276.             (e.pageY+offSetY) - document.layers[myLayer].top);
  1277.                 return true; 
  1278.         } else {
  1279.         document.all[myLayer].style.pixelLeft = (event.x+offSetX);
  1280.         document.all[myLayer].style.pixelTop = (event.y+offSetY);
  1281.         event.cancelBubble = true;
  1282.         event.returnValue = false;
  1283.     }
  1284. }
  1285. function CSMoveBy(action)
  1286. {
  1287.     x = CSGetStylePos(action[1], 0);
  1288.     y = CSGetStylePos(action[1], 1);
  1289.     x += parseInt(action[2]);
  1290.     y += parseInt(action[3]);
  1291.     x = CSSetStylePos(action[1], 0, x);
  1292.     y = CSSetStylePos(action[1], 1, y);
  1293. }
  1294. function CSMoveTo(action) { CSSlideLayer(action[1],action[2],action[3],action[4]); }
  1295. function CSHistoryGo(action) { history.go(action[1]); }
  1296. function RONavigateToURL (act) {
  1297.     var target,type,url,delay;
  1298.     url=act[1];
  1299.     type=act[2];
  1300.     if(type==0)target="_rpbrowser";
  1301.     else target="_rpexternal";
  1302.     delay=act[3]*1000;
  1303.     if(delay>0) {
  1304.         var obj=new Object();
  1305.         obj.type="navigate";
  1306.         obj.time=delay;
  1307.         obj.url=url;
  1308.         obj.target=target;
  1309.         if(ROOnPLCArray)
  1310.             ROOnPLCArray[ROOnPLCArray.length]=obj;
  1311.     }
  1312.     else
  1313.         window.parent.external.HandleAction("NavigateToURL("+url+","+target+")");
  1314. }
  1315. function CSFixFct() {
  1316.     var d = document; var w = window;
  1317.     if (d.cs.csFix.w != w.innerWidth || d.cs.csFix.h != w.innerHeight) {
  1318.         d.location = d.location; }
  1319. }
  1320. function CSNSFix(action) { 
  1321.     var d = document; var w = window;
  1322.     if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
  1323.         if (typeof d.cs == 'undefined') { 
  1324.             d.cs = new Object;
  1325.             d.cs.csFix = new Object; 
  1326.         } else if (CSIsFrame (w) == true) CSFixFct();
  1327.         d.cs.csFix.w = w.innerWidth;
  1328.         d.cs.csFix.h = w.innerHeight; 
  1329.         window.onresize = CSFixFct;
  1330.       }
  1331. }
  1332. function CSIsFrame (window) {
  1333.     var rootWindow = window.parent;
  1334.     if (rootWindow == 'undefined') return false;
  1335.     for (i = 0; i < rootWindow.frames.length; i++)
  1336.         if (window == rootWindow.frames[i]) return true;
  1337.     return false;
  1338. }
  1339. function CSOpenAlert(action) { alert(action[1]); }
  1340. function CSOpenWindow(action) {
  1341.     var wf = "";    
  1342.     wf = wf + "width=" + action[3];
  1343.     wf = wf + ",height=" + action[4];
  1344.     wf = wf + ",resizable=" + (action[5] ? "yes" : "no");
  1345.     wf = wf + ",scrollbars=" + (action[6] ? "yes" : "no");
  1346.     wf = wf + ",menubar=" + (action[7] ? "yes" : "no");
  1347.     wf = wf + ",toolbar=" + (action[8] ? "yes" : "no");
  1348.     wf = wf + ",directories=" + (action[9] ? "yes" : "no");
  1349.     wf = wf + ",location=" + (action[10] ? "yes" : "no");
  1350.     wf = wf + ",status=" + (action[11] ? "yes" : "no");        
  1351.     window.open(action[1],action[2],wf);
  1352. }
  1353. function CSOpenWindowPrompt(action) {
  1354. var where = self.location.href
  1355. var nw = prompt("Enter a new width:","")
  1356. if (nw != null) {
  1357. var nh = prompt("Enter a new height:","")
  1358. }
  1359. var wf = "";    
  1360. wf = wf + "width=" + nw;
  1361. wf = wf + ",height=" + nh;
  1362. wf = wf + ",resizable=" + (action[1] ? "yes" : "no");
  1363. wf = wf + ",scrollbars=" + (action[2] ? "yes" : "no");
  1364. wf = wf + ",menubar=" + (action[3] ? "yes" : "no");
  1365. wf = wf + ",toolbar=" + (action[4] ? "yes" : "no");
  1366. wf = wf + ",directories=" + (action[5] ? "yes" : "no");
  1367. wf = wf + ",location=" + (action[6] ? "yes" : "no");
  1368. wf = wf + ",status=" + (action[7] ? "yes" : "no");        
  1369.     if (nw == null || nh == null) { 
  1370.     return null
  1371.     } else {
  1372.     window.open(where,'testwin',wf);
  1373.     }
  1374. }
  1375. var actn1 = "";
  1376. var actn2 = "";
  1377. var pass=""
  1378. var z=23;
  1379. var y=28;
  1380. iCounter = 3;
  1381. if (Array) {
  1382.     var f= new Array();
  1383.     var K= new Array();
  1384.     var base= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z")
  1385. function inc(){
  1386. iCounter--
  1387. if (iCounter > 0)
  1388.     {
  1389.     if (confirm("\nPassword is incorrect.\n\n\n\nRetry?"))
  1390.         Check()
  1391.     } 
  1392.     else
  1393.         alert('Access Denied');
  1394. function Check(){
  1395. pass = prompt("Enter your password.","")
  1396. if(pass==null || pass==""){
  1397.     alert("You did not enter a password!");
  1398.     if(pass==""){
  1399.         Check()
  1400.     } 
  1401. else{
  1402.     var lpass=(pass.length)+1
  1403.     for (l=1; l<lpass; l++){
  1404.         K[l]=pass.charAt(l)
  1405.     } 
  1406.     var transmit=0;
  1407.     for (y=1; y<lpass; y++){
  1408.         for(x=0; x<62; x++){
  1409.             if (K[y]==base[x]){
  1410.                 transmit+=f[x]
  1411.                 transmit*=y
  1412.             } 
  1413.         } 
  1414.     } 
  1415.     if (transmit==parseInt(actn1))     
  1416.         go()
  1417.     else
  1418.         inc()
  1419. function go(){
  1420. alert(actn2);
  1421. location.href=pass+".html";
  1422. function PVpassword(action) { 
  1423. if (Array) { 
  1424.     actn1 = action[1];
  1425.     actn2 = action[2];
  1426.     z=23;
  1427.     y=28;
  1428.     for (x=0; x<10; x++){
  1429.         f[x]=x<<9
  1430.         f[x]+=23
  1431.     } 
  1432.     for (x=10; x<36; x++){
  1433.         y=y<<1
  1434.         v= Math.sqrt(y)
  1435.         v = parseInt(v,16)
  1436.         v+=5
  1437.         f[x]=v
  1438.         y++
  1439.     } 
  1440.     for (x=36; x<62; x++){
  1441.         z=z<<1
  1442.         v= Math.sqrt(z)
  1443.         v = parseInt(v,16)
  1444.         v+=74
  1445.         f[x]=v
  1446.         z++
  1447.     } 
  1448.     iCounter = 3;
  1449.     Check();
  1450. }
  1451. function CSPDFredirect(action) {    
  1452.     if(navigator.mimeTypes && navigator.mimeTypes["application/pdf"] && navigator.mimeTypes["application/pdf"].enabledPlugin) {
  1453.         location.href=action[1]
  1454.     }
  1455.     else if (navigator.appName == "Microsoft Internet Explorer") {
  1456.            x = confirm("The page you are trying to view requires the Adobe Portable Document Format (.PDF) browser plug-in or the Adobe Acrobat Reader application. We could not detect if your browser has this plug-in installed. To attempt to view the page anyway, click OK. Otherwise click CANCEL to view an alternate page")
  1457.         if (x == true)  location.href=action[1] 
  1458.     }
  1459.     else {
  1460.         x = confirm("Your browser may not be able to display PDF files. To attempt to view the PDF page anyway, click OK. Otherwise click CANCEL to view an alternate page")
  1461.         if (x == true)  location.href=action[1] 
  1462.     }         
  1463. }
  1464. function ROPlayClip (act) {
  1465.     var i,url,clipinfo,related_info_url,width,height,media_browser_url,target,delay,bnow_playing;
  1466.     url=act[1];
  1467.     related_info_url=act[2];
  1468.     if(related_info_url=="(EmptyReference!)")related_info_url="";
  1469.     width=act[3];
  1470.     height=act[4];
  1471.     media_browser_url=act[5];
  1472.     if(media_browser_url=="(EmptyReference!)")media_browser_url="";
  1473.     if(act[6]==0)target="_rpbrowser";
  1474.     else target="_rpexternal";
  1475.     delay=act[7]*1000;
  1476.     if(delay>0) {
  1477.         var obj=new Object();
  1478.         obj.type="navigate";
  1479.         obj.time=delay;
  1480.         obj.url=media_browser_url;
  1481.         media_browser_url="";
  1482.         obj.target=target;
  1483.         if(ROOnPLCArray)
  1484.             ROOnPLCArray[ROOnPLCArray.length]=obj;
  1485.     }
  1486.     bnow_playing=act[8];
  1487.     clipinfo="Album name="+act[9];
  1488.     clipinfo+="|Artist name="+act[10];
  1489.     clipinfo+="|CDNum="+act[11];
  1490.     clipinfo+="|Comments="+act[12];
  1491.     clipinfo+="|Genre="+act[13];
  1492.     clipinfo+="|Language="+act[14];
  1493.     clipinfo+="|Mood="+act[15];
  1494.     clipinfo+="|Preference="+act[16];
  1495.     clipinfo+="|Situation="+act[17];
  1496.     clipinfo+="|Title="+act[18];
  1497.     clipinfo+="|Year="+act[19];
  1498.     window.parent.external.PlayClip (url,clipinfo,related_info_url,width,height,media_browser_url,target,bnow_playing);
  1499. }
  1500. function CSPlayScene(action) { CSStartSeq (action[1]); }
  1501. var CSLastSound = null
  1502. function CSPlaySound(action) {
  1503.     if (eval('document.'+action[1])!=null) {
  1504.         if (CSLastSound != null && CSLastSound != action[1]) eval ('document.' + CSLastSound + '.stop()');
  1505.         CSLastSound = action[1]
  1506.         if (window.navigator.userAgent.indexOf("MSIE") > 0) eval ('document.' + CSLastSound + '.run()');
  1507.         else eval ('document.' + CSLastSound + '.play(true)');
  1508.     } else { alert ("The current Plug-In cannot be controlled by JavaScript. Please try using LiveAudio or a compatible Plug-In!"); }
  1509. }
  1510. CSImages=new Array();
  1511. function CSPreloadImage(action) {
  1512.     if (document.images) { CSImages[CSImages.length]=new Image(); CSImages[CSImages.length-1].src=action[1]; }
  1513. }
  1514. function ROPreloadURL (act) {
  1515.     ROPreloadURLArray[ROPreloadURLArray.length]=act[1];
  1516. }
  1517. ROPreloadURLArray=new Array();
  1518. function RPOnPreload() {    /* RO-Event-Handler */
  1519.     for(var i=0;i<ROPreloadURLArray.length;i++) {
  1520.         if (ROPreloadURLArray[i] != 0) {
  1521.             window.parent.external.PreloadURL(ROPreloadURLArray[i]);
  1522.             ROPreloadURLArray[i]=0;
  1523.         }
  1524.     }
  1525. }
  1526. function CSRandomImg(action) { 
  1527.     var img = CSGetImage(action[1]);
  1528.     if (img) 
  1529.         {
  1530.         var v1 =  Math.floor(Math.random() * 10);
  1531.         var whichone = v1-(Math.floor(v1/3)*3);
  1532.         img.src = action[whichone+2];
  1533.         }
  1534. }
  1535. function getCookie(thecookie){
  1536.     tempString= thecookie + "=";
  1537.     if(document.cookie.length>0){
  1538.         start = document.cookie.indexOf(tempString);
  1539.         if(start!=-1){
  1540.             end = document.cookie.indexOf(";",start);
  1541.             if(end==-1){end=document.cookie.length;}
  1542.             start += tempString.length;
  1543.             return unescape(document.cookie.substring(start,end))
  1544.         }
  1545.     }
  1546. }
  1547. function setCookie(thecookie,value,expire){
  1548.     cookieExpires = new Date
  1549.     cookieExpires.setMonth(cookieExpires.getMonth() + 6)
  1550.     document.cookie = thecookie + "=" + escape(value) + ";expires=" + cookieExpires.toGMTString();
  1551. }
  1552. function testCookie(thecookie){
  1553.     if(getCookie(thecookie)){
  1554.         return(getCookie(thecookie));
  1555.     }else{
  1556.         return false;
  1557.     }
  1558. }
  1559. function CSredPrompt(action) {
  1560.     var thecookie = action[5]
  1561.     if(testCookie(action[5]) && action[4] == true){    
  1562.             location.href=getCookie(action[5]);
  1563.     } else {
  1564.     var x = 0;
  1565.     }
  1566.     
  1567.     function kill() {
  1568.     alert(action[3]);
  1569.     x = 1;
  1570.     var enter = prompt(action[1],action[2]); 
  1571.     if (enter == action[6]){setCookie(action[5], action[7]);location.href=action[7];}
  1572.     else if (enter == action[8]){setCookie(action[5], action[9]);location.href=action[9];}
  1573.     else if (enter == action[10]){setCookie(action[5], action[11]);location.href=action[11];}
  1574.     else if (enter == action[12]){setCookie(action[5], action[13]);location.href=action[13];}
  1575.     else if (enter == action[15]){setCookie(action[5], action[16]);location.href=action[16];}
  1576.     else if (enter == action[2]){kill();}
  1577.     else if (enter == null) return
  1578.     else  kill()
  1579.     }
  1580.     if (x == 0) {
  1581.     var enter = prompt(action[1],action[2]); 
  1582.     if (enter == action[6]){setCookie(action[5], action[7]);location.href=action[7];}
  1583.     else if (enter == action[8]){setCookie(action[5], action[9]);location.href=action[9];}
  1584.     else if (enter == action[10]){setCookie(action[5], action[11]);location.href=action[11];}
  1585.     else if (enter == action[12]){setCookie(action[5], action[13]);location.href=action[13];}
  1586.     else if (enter == action[14]){setCookie(action[5], action[15]);location.href=action[15];}
  1587.     else if (enter == action[2]){kill();}
  1588.     else if (enter == null) return
  1589.     else  kill()
  1590.     }
  1591. }
  1592. function CSResizeWindow(action) { 
  1593.     if(navigator.appVersion.charAt(0) >=4) { window.resizeTo (action[1],action[2]) }
  1594. }
  1595. function CSScrollDown(action){
  1596.     if(navigator.appVersion.charAt(0) >=4) {
  1597.         var container = 0    
  1598.         if (action[2] > 0)        {
  1599.             while (container < action[1]) {
  1600.                    window.scrollBy(0,action[2]);
  1601.                    container = container + action[2];  
  1602.             }     
  1603.           }
  1604.     }
  1605. }
  1606. function CSScrollLeft(action){
  1607.     if(navigator.appVersion.charAt(0) >=4) {
  1608.         var container = 0    
  1609.         if (action[2] > 0)        {
  1610.             while (container < action[1]) {
  1611.                    window.scrollBy(-action[2],0);
  1612.                    container = container + action[2];  
  1613.             }     
  1614.           }
  1615.     }
  1616. }
  1617. function CSScrollRight(action){
  1618.     if(navigator.appVersion.charAt(0) >=4) {
  1619.         var container = 0    
  1620.         if (action[2] > 0)        {
  1621.             while (container < action[1]) {
  1622.                    window.scrollBy(action[2],0);
  1623.                    container = container + action[2];  
  1624.             }     
  1625.           }
  1626.     }
  1627. }
  1628. function CSScrollUp(action){
  1629.     if(navigator.appVersion.charAt(0) >=4) {
  1630.         var container = 0    
  1631.         if (action[2] > 0)        {
  1632.             while (container < action[1]) {
  1633.                    window.scrollBy(0,-action[2]);
  1634.                    container = container + action[2];  
  1635.             }     
  1636.           }
  1637.     }
  1638. }
  1639. function CSScrollstatus(action) {
  1640. phrase = action[1];
  1641. speed = action[2];    
  1642. (action[3] != true)    ? delay = setTimeout("CSScrollleftidle()",20) : delay = setTimeout("CSScrollrightidle()",20)
  1643. var thestring
  1644. leftphrase = "                                                                                                 " + phrase 
  1645. charnum = leftphrase.length;
  1646. stringnum = leftphrase.length;    
  1647. size = leftphrase.length+1
  1648. }
  1649. function CSScrollrightidle() {
  1650.     stringnum--;
  1651.     (stringnum != 0) ? window.status = leftphrase.substring(charnum,stringnum) : stringnum = charnum
  1652.     delay = setTimeout("CSScrollrightidle()",speed); 
  1653.     }
  1654.     
  1655. function CSScrollleftidle() {
  1656.    thestring = leftphrase.substring(0,1);
  1657.    leftphrase += thestring
  1658.    leftphrase = leftphrase.substring(1,size);
  1659.    window.status = leftphrase.substring(0,size);
  1660.    delay = setTimeout("CSScrollleftidle()",speed);
  1661. }
  1662. function CSSearchEngine(action) {
  1663. var form = action[1]
  1664. var elem = action[2]
  1665. var theEntry  
  1666. if(action[3]==true) { theEntry = action[4] } 
  1667. else { theEntry = document.forms[form].elements[elem].value }
  1668. var type=action[5];
  1669. if(type==0) engine="http://search.adobe.com/cgi-bin/query?mss=simple&pg=q&what=web&fmt=.&where=www_search_main&superq="+theEntry+"&rd=all&q="+theEntry+"&x=39&y=10" /* Adobe.com */
  1670. else if(type==1) engine="http://www.altavista.digital.com/cgi-bin/query?pg=q&what=web&fmt=.&q="+theEntry /* Altavista */   
  1671. else if(type==2) engine="http://groups.google.com/groups?q="+theEntry+"&hl=en&lr=&safe=off&btnG=Google+Search&site=groups"; /* Google Deja News (Usenet) */  
  1672. else if(type==3) engine="http://www.excite.com/search.gw?trace=a&search="+theEntry; /* Excite */
  1673. else if(type==4) engine="http://www.search.hotbot.com/hResult.html?SM=MC&MT="+theEntry+"&DV=7&RG=.com&DC=10&DE=2&OPs=MDRTP&_v=2&DU=days&SW=web&search.x=23&search.y=8"; /* HotBot */  
  1674. else if(type==5) engine="http://www.google.com/search?q="+theEntry+"&btnG=Google+Search" /* Google */
  1675. else if(type==6) engine="http://search.msn.com/results.asp?RS=CHECKED&FORM=MSNH&v=1&q="+theEntry; /* MSN */
  1676. else if(type==7) engine="http://www.lycos.com/cgi-bin/pursuit?query="+theEntry+"&matchmode=and&cat=lycos&x=33&y=10"; /* Lycos */
  1677. else if(type==8) engine="http://shopper.cnet.com/shopping/search/results/1,10214,0-1257,00.html?tag=st%2Esh%2E1257%2Esbsr&qt="+theEntry+"&cn=&ca=1257" /* Shopper.com */
  1678. else if(type==9) engine="http://search.excite.com/search.gw?c=web&lk=webcrawler&onload=&s="+theEntry;/* Webcrawler */
  1679. else if(type==10) engine="http://search.yahoo.com/bin/search?p="+theEntry /* Yahoo */
  1680. if (theEntry=="") { alert("Please enter a search keyword!") } 
  1681. else  { newWindow=window.open(engine, action[6],"toolbar,location,directories,status,menubar,scrollbars,resizable=1") }
  1682. }
  1683.         
  1684. function CSSetBackColor(action) { document.bgColor = action[1]; }
  1685. function CSSetImageURL(action) {
  1686.     var img=CSGetImage(action[1]);
  1687.     if (img) img.src=action[2];
  1688. }
  1689. function CSSetStatus(action) { self.status = action[1]; }
  1690. function ROSetVideoBackgroundColor (act) {
  1691.     var delay,color;
  1692.     color="#";
  1693.     color+=act[1];
  1694.     delay=act[2]*1000;
  1695.     if(delay>0) {
  1696.         var obj=new Object();
  1697.         obj.type="color";
  1698.         obj.time=delay;
  1699.         obj.color=color;
  1700.         if(ROOnPLCArray)
  1701.             ROOnPLCArray[ROOnPLCArray.length]=obj;
  1702.     }
  1703.     else
  1704.         window.parent.external.SetVideoBackgroundColor(color);
  1705. }
  1706. function ROShowArtistInfo (act) {
  1707.     var show;
  1708.     if(act[1]==true)show=1;
  1709.     else show=0;
  1710.     window.parent.external.HandleAction("ShowArtistInfo("+show+")");
  1711. }
  1712. function ROShowPreferences (act) {
  1713.     var str,type;
  1714.     type=act[1];
  1715.     str="ShowPreferences(";
  1716.     if(type==0)str+="General,General";
  1717.     else if(type==1)str+="Connection,Connection";
  1718.     else if(type==2)str+="Connection,Playback Settings";
  1719.     else if(type==3)str+="Connection,Internet Settings";
  1720.     else if(type==4)str+="Connection,Proxy";
  1721.     else if(type==5)str+="Connection,Network Transports";
  1722.     else if(type==6)str+="My Library,My Library";
  1723.     else if(type==7)str+="My Library,Advanced My Library";
  1724.     else if(type==8)str+="CD,CD";
  1725.     else if(type==9)str+="CD,Advanced CD";
  1726.     else if(type==10)str+="Devices,Devices";
  1727.     else if(type==11)str+="Accessories,Accessories";
  1728.     else if(type==12)str+="Media Types,Media Types";
  1729.     else if(type==13)str+="Content,Content";
  1730.     else if(type==14)str+="Hardware,Hardware";
  1731.     else if(type==15)str+="AutoUpdate,AutoUpdate";
  1732.     else return;
  1733.     str+=")";
  1734.     window.parent.external.HandleAction(str);
  1735. }
  1736. function CSShowHide(action) {
  1737.     if (action[1] == '') return;
  1738.     var type=action[2];
  1739.     if(type==0) CSSetStyleVis(action[1],0);
  1740.     else if(type==1) CSSetStyleVis(action[1],1);
  1741.     else if(type==2) { 
  1742.         if (CSGetStyleVis(action[1]) == 0) CSSetStyleVis(action[1],1);
  1743.         else CSSetStyleVis(action[1],0);
  1744.     }
  1745. }
  1746. function CSSlideNewWindow(action) {
  1747. var wh = ""
  1748. if (action[7] || action[8] || action[9] == true) wh=action[4]-125
  1749. else wh = action[4]
  1750. var wf = "";    
  1751. wf = wf + "width=" + action[3];
  1752. wf = wf + ",height=" + wh;
  1753. wf = wf + ",resizable=" + (action[5] ? "yes" : "no");
  1754. wf = wf + ",scrollbars=" + (action[6] ? "yes" : "no");
  1755. wf = wf + ",menubar=" + (action[7] ? "yes" : "no");
  1756. wf = wf + ",toolbar=" + (action[8] ? "yes" : "no");
  1757. wf = wf + ",directories=" + (action[9] ? "yes" : "no");
  1758. wf = wf + ",location=" + (action[10] ? "yes" : "no");
  1759. wf = wf + ",status=" + (action[11] ? "yes" : "no");        
  1760. if(navigator.appVersion.charAt(0) >=4) {
  1761. var sw=screen.width-20;
  1762. var sh=screen.height;
  1763. var newwidth=action[3]; 
  1764. var newheight=action[4];
  1765. var positionleft=(sw-newwidth)/2;
  1766. var positiontop=""
  1767. if (action[7] || action[8] || action[9] == true) positiontop=(sh-newheight)/3;
  1768. else positiontop=(sh-newheight)/2.5;
  1769. }
  1770. newwindow=window.open(action[1],action[2],wf); 
  1771. newwindow.focus()    
  1772. if(navigator.appVersion.charAt(0) >=4) {
  1773.     for(width1 = 1 ; width1 < positionleft ; width1 = width1 + 10)
  1774.     newwindow.moveTo(width1,positiontop)
  1775.     }
  1776. }
  1777. SSnumimg=1; SSsens2=-1;SSsens3=-1
  1778. function CSSlideShow(action) 
  1779. {
  1780. SSmax=action[2]
  1781. SSimgNom=action[1]
  1782. SSloop=action[4]
  1783. SSsens=action[3] 
  1784. SSpalin=action[5]
  1785. var SSimg = null;
  1786.     if (document.images) {
  1787.         if (!IsIE()&&CSBVers<5) SSimg = CSFindElement(SSimgNom,0);
  1788.         else SSimg = document.images[SSimgNom];
  1789. SSstr=SSimg.src
  1790. SSn=SSstr.length
  1791. SSp=SSn-6
  1792. SSpstr=SSstr.substring(0,SSp)
  1793. SSnimg=SSstr.substring(SSp,SSp+2)
  1794. SSformat=SSstr.substring(SSp+2,SSn)
  1795. if (SSformat==".jpg" || SSformat==".JPG" || SSformat==".gif" || SSformat==".GIF")
  1796. {}
  1797. else
  1798. {
  1799.  alert("Image extension must be .jpg or .gif (case sensitive). Images must be numbered 01, 02 ...")
  1800. }
  1801. slide(SSmax,SSformat,SSpstr,SSnimg,SSimgNom,SSloop,SSpalin)
  1802. }
  1803. }
  1804. function slide(SSmax,SSformat,SSpstr,SSnimg,SSimgNom,SSloop,SSpalin)
  1805. {
  1806. if (SSsens2==true) {SSsens=true}
  1807. if (SSsens2==false) {SSsens=false}
  1808. if (SSsens==true) 
  1809. {
  1810. SSsuite=SSnumimg-1
  1811.     if (SSnumimg>SSmax)SSsuite=SSmax
  1812.     if (SSnumimg<=1 & SSloop==true & SSpalin!=true) { SSsuite=SSmax }
  1813.     if (SSnumimg<=1 & SSloop==true & SSpalin==true) { 
  1814.         if (SSsens2==-1 & SSsens3==-1) {SSsuite=SSmax;SSsens3=1} else { SSsuite=SSnumimg+1; SSsens2=false }}
  1815.     if (SSnumimg<=1 & SSloop!=true & SSpalin!=true) {
  1816.         if  (SSsens2==-1 & SSsens3==-1) { SSsuite=SSmax;SSsens3=1 } else {SSsuite=SSnumimg; SSfini()}}
  1817. }
  1818. else
  1819. {
  1820. SSmax=SSmax-1
  1821. SSsuite=SSnumimg+1
  1822.     if (SSnumimg>SSmax & SSloop==true & SSpalin!=true) { SSsuite=1}
  1823.     if (SSnumimg>SSmax & SSloop==true & SSpalin==true) {SSsuite=SSnumimg-1; SSsens2=true }
  1824.     if (SSnumimg>SSmax & SSloop!=true &  SSpalin!=true) { SSsuite=SSnumimg;SSfini() }
  1825.     if (SSnumimg<1) SSsuite=1
  1826. }
  1827. SSnumimg=SSsuite
  1828. if (SSsuite<10) {
  1829.     SSaller="0"+SSsuite
  1830.     }
  1831.     else SSaller=SSsuite
  1832. SSsource=SSpstr+SSaller+SSformat
  1833. var SSimg = null;
  1834.     if (document.images) {
  1835.         if (!IsIE()&&CSBVers<5) SSimg = CSFindElement(SSimgNom,0);
  1836.         else SSimg = document.images[SSimgNom];
  1837.         if (SSimg) SSimg.src = SSsource;
  1838.     }
  1839. }
  1840. function SSfini() {
  1841. }
  1842. function CSSlideShowAuto(action) 
  1843. {
  1844. SSAfini=0
  1845. SSAnumimg=0
  1846. SSAmax=action[2]
  1847. SSAimgNom=action[1]
  1848. SSAtemps=action[3]*1000
  1849. if (action[4]==true) 
  1850.         {
  1851.         SSAstop=true
  1852.         }
  1853.     else SSAstop=false
  1854. var SSAimg = null;
  1855.     if (document.images) {
  1856.         if (!IsIE()&&CSBVers<5) SSAimg = CSFindElement(SSAimgNom,0);
  1857.         else SSAimg = document.images[SSAimgNom];
  1858. str=SSAimg.src
  1859. n=str.length
  1860. p=n-6
  1861. SSApstr=str.substring(0,p)
  1862. SSAnimg=str.substring(p,p+2)
  1863. SSAformat=str.substring(p+2,n)
  1864. if (SSAformat==".jpg" || SSAformat==".JPG" || SSAformat==".gif" || SSAformat==".GIF")
  1865. {}
  1866. else
  1867. {
  1868.  alert("Image extension must be .jpg or .gif (case sensitive). Images must use 2 digit naming starting with 01, 02 ... plus extension")
  1869. }
  1870. if (SSAnimg.substring(0,1)=="0") 
  1871. {
  1872. SSAnumimg=Number(SSAnimg.substring(1,2))
  1873. }
  1874. else
  1875. {SSAnumimg=Number(SSAnimg)}
  1876. SSAtempo(SSAmax,SSAimgNom,SSAtemps,SSAstop,SSApstr,SSAnimg,SSAformat)
  1877. }
  1878. }
  1879. function SSAtempo(SSAmax,SSAimgNom,SSAtemps,SSAstop,SSApstr,SSAnimg,SSAformat)
  1880. {
  1881. setTimeout("slideAuto(SSAmax,SSAimgNom,SSAstop,SSApstr,SSAnimg,SSAformat)",SSAtemps)
  1882. }
  1883. function slideAuto(SSAmax,SSAimgNom,SSAstop,SSApstr,SSAnimg,SSAformat)
  1884. {
  1885. if (SSAfini==1) {
  1886. SSAnumimg = SSAnumimg-2
  1887. CSSlideShowAutoPause()
  1888. }
  1889. else 
  1890. {
  1891. SSAmax=SSAmax-1
  1892. SSAsuite=SSAnumimg+1
  1893.     if (SSAnumimg>SSAmax)
  1894.         {
  1895.         SSAsuite=1
  1896.         if (SSAstop==true) SSAfini=1
  1897.         else
  1898.         SSAfini=0
  1899.         }
  1900.     if (SSAnumimg<1) SSAsuite=1
  1901. SSAnumimg=SSAsuite
  1902. if (SSAsuite<10) {
  1903.     SSAaller="0"+SSAsuite
  1904.     }
  1905.     else SSAaller=SSAsuite
  1906. SSAsource=SSApstr+SSAaller+SSAformat
  1907. var SSAimg = null;
  1908.     if (document.images) {
  1909.         if (!IsIE()&&CSBVers<5) SSAimg = CSFindElement(SSAimgNom,0);
  1910.         else SSAimg = document.images[SSAimgNom];
  1911.         if (SSAimg) SSAimg.src = SSAsource;
  1912.     }
  1913. SSAtempo(SSAmax,SSAimgNom,SSAtemps,SSAstop,SSApstr,SSAnimg,SSAformat)
  1914. }
  1915. }
  1916. function CSSlideShowAutoPause() 
  1917. {}
  1918. function CSSlideShowAutoStop(action) 
  1919. {
  1920. if (SSAfini==0) SSAfini=1
  1921. else SSAfini=0 ; SSAnumimg = SSAnumimg+2 ;  slideAuto(SSAmax,SSAimgNom,SSAstop,SSApstr,SSAnimg,SSAformat)
  1922. }
  1923. function CSStopAll(action) { CSStopComplete (); }
  1924. function CSStopScene(action) { CSStopFunction (action[1]); }
  1925. function CSStopSound (action) {if (eval('document.'+action[1])!=null) { eval ('document.' + action[1] + '.stop()');}}
  1926. function CSSVGredirect(action){   
  1927.      if(navigator.mimeTypes && navigator.mimeTypes["image/svg-xml"] && navigator.mimeTypes["image/svg-xml"].enabledPlugin ) {
  1928.         location.href=action[1]
  1929.     }
  1930.      else if (navigator.appName == "Microsoft Internet Explorer") {
  1931.            x = confirm("The page you are trying to view requires the Adobe Scaling Vector Graphics (.SVG) browser plug-in. We could not detect if your browser has this plug-in installed. To attempt to view the page anyway, click OK. Otherwise click CANCEL to view an alternate page")
  1932.             if (x == true)  location.href=action[1] 
  1933.     }
  1934.     else if(action[2] == true) {
  1935.         alert(action[3])
  1936.     }         
  1937. }
  1938.         
  1939. function CSSWFredirect(action) {    
  1940.     if(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
  1941.         location.href=action[1]
  1942.     }
  1943.    else if (navigator.appName == "Microsoft Internet Explorer") {
  1944.            x = confirm("The page you are trying to view requires the Macromedia Flash (.SWF) browser plug-in. We could not detect if your browser has this plug-in installed. To attempt to view the page anyway, click OK. Otherwise click CANCEL to view an alternate page")
  1945.             if (x == true)  location.href=action[1] 
  1946.     }
  1947.     else if(action[2] == true) {
  1948.         alert(action[3])
  1949.     }         
  1950. }
  1951. function CSPAKtrg2frames(action) { 
  1952.     parent.frames[action[1]].location.href = action[2]
  1953.     parent.frames[action[3]].location.href = action[4]
  1954.  }
  1955. function CSPakRemote(action) { 
  1956.     if (TRversion()) {
  1957.         if (action[2].length < 1) {
  1958.             opener.location.href=action[1];
  1959.         }
  1960.         else {
  1961.             opener.parent.frames[action[2]].location.href=action[1];
  1962.         }
  1963.     }
  1964.     return;
  1965. }
  1966. function TRversion() {
  1967.     return (navigator.appName.indexOf("Netscape") >= 0 && parseInt(navigator.appVersion.charAt(0)) >= 3)
  1968.           || (navigator.appName.indexOf("Explorer") >= 0 && parseInt(navigator.appVersion.charAt(0)) >= 3);
  1969. }
  1970. function timeRedirect(action) {
  1971. var now = new Date();
  1972. var hours = now.getHours();
  1973. var timeValue = action[1];
  1974. if (timeValue >= 12) { timeValue = timeValue - 12; } /* deals with 24-hour time */
  1975. if (action[2] == true) { timeValue += 12; } /* deals with PM times */
  1976. if (hours < timeValue && action[4] != "(Empty Reference!)" && action[4] != "(EmptyReference!)" && action[3] == true) {
  1977. window.location = action[4]; }
  1978. if (hours >= timeValue && action[6] != "(Empty Reference!)" && action[6] != "(EmptyReference!)" && action[5] == true) {
  1979. window.location = action[6]; }
  1980. }
  1981. function CSTimeout (condition) {
  1982.     var result = false;
  1983.     if (typeof (gCurrentIdleObject) == "undefined")    return result;
  1984.     if (gCurrentIdleObject.lastTime) {
  1985.         var t=new Date();
  1986.         if (t.getTime() >= gCurrentIdleObject.lastTime) { 
  1987.             if (t.getTime() >= gCurrentIdleObject.nextTime) { 
  1988.                 gCurrentIdleObject.lastTime = t.getTime() + condition[1]*1000;
  1989.                 gCurrentIdleObject.nextTime = gCurrentIdleObject.lastTime + condition[1]*1000;
  1990.                 return false;
  1991.             }
  1992.             return true;
  1993.         }
  1994.     } else { 
  1995.         var t=new Date();
  1996.         gCurrentIdleObject.lastTime = t.getTime() + condition[1]*1000;
  1997.         gCurrentIdleObject.nextTime = gCurrentIdleObject.lastTime + condition[1]*1000;
  1998.     }
  1999.     return result;
  2000. }
  2001. function CSvisits(action) {
  2002. mycookie = action[8]
  2003. cookieExpires = new Date
  2004. cookieExpires.setMonth(cookieExpires.getMonth() + 12)
  2005. visits = eval(cookieVal(mycookie))
  2006. visits++
  2007. document.cookie = mycookie+"="+visits+";expires=" + cookieExpires.toGMTString()
  2008.                 
  2009. function cookieVal(cookieName) {
  2010.     thisCookie = document.cookie.split("; ")
  2011.         for (i=0; i<thisCookie.length; i++) {
  2012.             if (cookieName == thisCookie[i].split("=")[0]) {
  2013.             return thisCookie[i].split("=")[1]
  2014.             }
  2015.     }
  2016.  return 0
  2017. }
  2018.     if(visits == 1 && action[1] == true) alert(action[2])
  2019.     else
  2020.     if(action[5] == true) alert(action[3] + " " + visits)
  2021.     if(action[6] == true) {
  2022.         if(visits == action[7])
  2023.         alert(action[4])
  2024.         }
  2025. }
  2026.         
  2027. function CSVisitorCookie(action) 
  2028. {
  2029. resultat = "visitor"
  2030. cookiename = action[1]
  2031. goUrl = action[2]
  2032. var arg = cookiename + "=";
  2033.   var alen = arg.length;
  2034.   var clen = document.cookie.length;
  2035.   var i = 0;
  2036.   while (i < clen) {
  2037.     var j = i + alen;
  2038.        if (document.cookie.substring(i, j) == arg)
  2039.      return CSVisitorGetCookie (j);
  2040.     i = document.cookie.indexOf(" ", i) + 1;
  2041.     if (i == 0) break; 
  2042.   }
  2043.   VisitorSetCookie(cookiename)
  2044.   return null; 
  2045. }
  2046. function CSVisitorGetCookie (offset) {
  2047.   var endstr = document.cookie.indexOf (";", offset);
  2048.   if (endstr == -1) 
  2049.     endstr = document.cookie.length;
  2050.   valeur=unescape(document.cookie.substring(offset, endstr))
  2051.   if (valeur==resultat)
  2052.   VisitorGotoLink(goUrl)
  2053.   else
  2054.   VisitorSetCookie(cookiename)
  2055. }
  2056. function VisitorGotoLink(goUrl) {
  2057. location = goUrl
  2058. }
  2059. function VisitorSetCookie(cookiename) 
  2060. {
  2061. var value="visitor"
  2062. var jours=500*24
  2063. path="/"
  2064. domain=null
  2065. var expdate = new Date ();
  2066. expdate.setTime (expdate.getTime() + (jours * 60 * 60 * 1000));
  2067. SetCookie(cookiename,value,expdate)
  2068. }
  2069. function SetCookie (cookiename, value) {
  2070.   var argv = SetCookie.arguments;
  2071.   var argc = SetCookie.arguments.length;
  2072.   var expires = (argc > 2) ? argv[2] : null;
  2073.   var secure = (argc > 5) ? argv[5] : false;
  2074.   document.cookie = cookiename + "=" + escape (value) +
  2075.     ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
  2076.     ((path == null) ? "" : ("; path=" + path)) +
  2077.     ((domain == null) ? "" : ("; domain=" + domain)) +
  2078.     ((secure == true) ? "; secure" : "");
  2079. }
  2080. function CSStartWipe (action)
  2081. {
  2082.     var el=CSCreateTransElement (action[1], action[2]);
  2083.     if (el==null) return;
  2084.     var dir=action[3];
  2085.     if (dir=="_inLeft") {el.steps=el.clipRect.width/el.maxValue; el.modus="in";}
  2086.     else if (dir=="_inRight") {el.steps=el.clipRect.width/el.maxValue; el.modus="in";}
  2087.     else if (dir=="_outLeft") {el.steps=el.clipRect.width/el.maxValue; el.modus="out";}
  2088.     else if (dir=="_outRight") {el.steps=el.clipRect.width/el.maxValue; el.modus="out";}
  2089.     else if (dir=="_inTop") {el.steps=el.clipRect.height/el.maxValue; el.modus="in";}
  2090.     else if (dir=="_inBottom") {el.steps=el.clipRect.height/el.maxValue; el.modus="in";}
  2091.     else if (dir=="_outTop") {el.steps=el.clipRect.height/el.maxValue; el.modus="out";}
  2092.     else if (dir=="_outBottom") {el.steps=el.clipRect.height/el.maxValue; el.modus="out";}
  2093.     else if (dir=="_inCenter") {el.HSteps=el.clipRect.width/el.maxValue; el.VSteps=el.clipRect.height/el.maxValue; el.modus="in";}
  2094.     else if (dir=="_outCenter") {el.HSteps=el.clipRect.width/el.maxValue; el.VSteps=el.clipRect.height/el.maxValue; el.modus="out";}
  2095.     if (el.modus=="") return;
  2096.     el.currentValue=0;
  2097.     el.glDir=action[3];
  2098.     CSStartFunction(CSDoWipe,el);
  2099. }
  2100. function CSDoWipe (info)
  2101. {
  2102.     var el = info.data;
  2103.     if (el==null) return false;
  2104.     if (el.currentValue==el.maxValue) { CSFinishWipe(el); return false; }
  2105.     var r = new CSRect(el.clipRect.left,el.clipRect.top,el.clipRect.width,el.clipRect.height);
  2106.     var dir=el.glDir;
  2107.     if (dir=="_inLeft") {r.left=r.width-el.currentValue*el.steps;}
  2108.     else if (dir=="_inTop") {r.top=r.height-el.currentValue*el.steps;}
  2109.     else if (dir=="_inRight") {r.width=el.currentValue*el.steps;}
  2110.     else if (dir=="_inBottom") {r.height=el.currentValue*el.steps;}
  2111.     else if (dir=="_outLeft") {r.width=r.width-el.currentValue*el.steps;}
  2112.     else if (dir=="_outTop") {r.height=r.height-el.currentValue*el.steps;}
  2113.     else if (dir=="_outRight") {r.left=el.currentValue*el.steps;}
  2114.     else if (dir=="_outBottom") {r.top=el.currentValue*el.steps;}
  2115.     else if (dir=="_inCenter") {r=CSCenterRectIn(el,r);}
  2116.     else if (dir=="_outCenter") {r=CSCenterRectOut(el,r);}
  2117.     CSSetLayerClip(el,r);
  2118.     el.currentValue+=1;
  2119.     return true;
  2120. }
  2121. function CSFinishWipe (el)
  2122. {
  2123.     if (el.modus=="in") CSSetLayerClip(el,el.clipRect);
  2124.     else { 
  2125.         el.clipRect=new CSRect(0,0,el.width,el.height); 
  2126.         CSSetLayerClip(el,el.clipRect); 
  2127.         CSSetStyleVis(el.layer,0);
  2128.     }
  2129.     CSDisposeTransElement(el);
  2130. }
  2131. function CSCenterRectIn(el,r)
  2132. {
  2133.     var hValue= el.currentValue*el.HSteps/2;
  2134.     var vValue= el.currentValue*el.VSteps/2;
  2135.     r.left=Math.round(r.left+r.width/2-hValue); 
  2136.     r.top=Math.round(r.top+r.height/2-vValue); 
  2137.     r.width=Math.round(hValue*2);
  2138.     r.height=Math.round(vValue*2);
  2139.     return r;
  2140. }
  2141. function CSCenterRectOut(el,r)
  2142. {
  2143.     var hValue= el.currentValue*el.HSteps/2;
  2144.     var vValue= el.currentValue*el.VSteps/2;
  2145.     r.left+=Math.round(hValue); 
  2146.     r.top+=Math.round(vValue); 
  2147.     r.width-=Math.round(hValue*2);
  2148.     r.height-=Math.round(vValue*2);
  2149.     return r;
  2150. }
  2151. function CSshowtime(action) { 
  2152. message = action[1]
  2153. military = action[2]
  2154. offset = action[3] 
  2155. dst = action[4]
  2156. statuscheck = action[5]
  2157. formcheck = action[6]
  2158. form = action[7];
  2159. elem = action[8];
  2160. var dstoffset = 0
  2161. theTimer = setTimeout("theClock()",10);
  2162.     
  2163. function theClock() {   
  2164. clearTimeout(theTimer);
  2165. var now = new Date();
  2166. var correct = now.toGMTString();
  2167. time_string = correct.split(' ');
  2168. hm = time_string[4];
  2169. hm_string = hm.split(':');
  2170. var hours = hm_string[0] - 0;
  2171. var suffix = " A.M."
  2172. if (dst == true) dstoffset = 1
  2173. hours = hours + offset + dst;
  2174.     if (hours < 0) hours +=24    
  2175.     if (hours > 11 && hours < 24)  suffix = " P.M."
  2176.     if (hours > 12 && military == false) hours -=12;
  2177.     
  2178. var minutes = now.getMinutes();
  2179. var timeValue12 = "" + ((hours > 12) ? hours -12 : hours)
  2180. if (timeValue12 == 0) timeValue12 = 12
  2181. var timeValue24 = "" + ((hours > 23) ? hours -24 : hours)
  2182. timeValue12 += ((minutes < 10) ? ":0" : ":") + minutes
  2183. timeValue12 += suffix
  2184. timeValue24 += ((minutes < 10) ? ":0" : ":") + minutes
  2185.     if(military == false)  {
  2186.     WorldTime = message + timeValue12;
  2187.     } else { 
  2188.     WorldTime = message + timeValue24
  2189.     }  
  2190.     if(statuscheck == true)  window.status = WorldTime
  2191.     if(formcheck == true)  document.forms[form].elements[elem].value  = WorldTime
  2192. theTimer = setTimeout("theClock()",5000);
  2193. }
  2194. /* EOF */
  2195.